TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
ab,bc,ca = map(int,input().split())

print(ab*bc/2)

ab,bc,ca = map(int,input().split())

print(int(ab*bc/2))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
a, b, c =map(int,input().split())
if a**2+b**2 ==c**2:
  print(a*b/2)
elif b**2 + c**2 ==a**2:
  print(b*c/2)
else:
  print(c*a/2)

a, b, c =map(int,input().split())
if a**2+b**2 ==c**2:
  print(a*b//2)
elif b**2 + c**2 ==a**2:
  print(b*c//2)
else:
  print(c*a//2)


Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
a,b,c = map(int,input().split())
print((a*b)/2)

a,b,c = map(int,input().split())
print(int((a*b)/2))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
p = input().split()
k = []
for i in p:
  k.append(int(i))
k.sort()
print(k[0]*k[1]/2)

p = input().split()
k = []
for i in p:
  k.append(int(i))
k.sort()
print(int(k[0]*k[1]/2))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
a,b,c = map(int,input().split())
print(0.5*a*b)

a,b,c = map(int,input().split())
print(int(0.5*a*b))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
a, b, c = map(int,input().split())
print((a * b) / 2)

a, b, c = map(int,input().split())
print((a * b) // 2)

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
ab,bc,ca = map(int,input().split())
print(ab * ac // 2)

ab,bc,ca = map(int,input().split())
print(ab * bc // 2)

Verdicts: Runtime Error

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
ab, bc, ca = map(int, input().split())
print(ab*bc/2)

ab, bc, ca = map(int, input().split())
print(int(ab*bc/2))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
x,y,z = map(int, input().split())
ans = (x*y)/2
print(ans)

x,y,z = map(int, input().split())
ans = x*y*0.5
print(ans)

x,y,z = map(int, input().split())
ans = x*y/2
print(ans)

x, y, z = map(int, input().split())
ans = x*y//2
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
numbers = input().split()
numbers.sort()
a = int(numbers[0])
b = int(numbers[1])
print(a*b/2)

a,b,c = map(int,input().split())
print(a*b/2)

a,b,c = map(int,input().split())
print(int(a*b/2))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
A , B , _ = map(int,input().split())
print(A * B / 2)

ab, bc ,_ = map(int,input().split())
print(ab * bc // 2)

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
l1, l2, l3 = map(int,input().split())
print(l1 * l2 / 2)

l1, l2, l3 = map(int,input().split())
print(int(l1 * l2 / 2))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
# ABC116
# A Right Triangle
L = list(map(int, input().split()))
L = sorted(L)
print(L[0]*L[1]/2)


# ABC116
# A Right Triangle
L = list(map(int, input().split()))
L = sorted(L)
print(int(L[0]*L[1]/2))


Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
A,B,C=map(int,input().split())
S=0
if A>B and A>C:
    S=B*C/2
elif B>A and B>C:
    S=A*C/2
else:
    S=A*B/2
print(S)

A,B,C=map(int,input().split())
S=0
if A>B and A>C:
    S=B*C/2
elif B>A and B>C:
    S=A*C/2
else:
    S=A*B/2
print(int(S))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
a, b, c = map(int, input().split())
print(a*b/2)


a, b, c = map(int, input().split())
print(int(a*b/2))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
A, B, _ = input().split()

print(int(A)*int(B)/2)


A, B, _ = input().split()

print(int(int(A)*int(B)/2))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
l = list(map(int, input().split()))
a=l[0]*l[1]/2
print(a)


l = list(map(int, input().split()))
a=l[0]*l[1]/2
print(int(a))


Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
a, b, c = map(int, input().split())

print((int)a*b/2)

a, b, c = map(int, input().split())

print(a*b/2)

a, b, c = (int(i) for i in input().split())

print(a*b/2)

a, b, c = map(int, input().split())

print((int)(a*b/2))

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
A,B,C=map(int,input().split())
l=[A,B,C]
l.sort()

print(l[0]*l[1])

A,B,C=map(int,input().split())
l=[A,B,C]
l.sort()

print(int((l[0]*l[1])/2))

Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
AB, BC, CA = map(int, input().split())

print(AB * BC / 2)


AB, BC, CA = map(int, input().split())

print(int(AB * BC / 2))


Verdicts: Wrong Answer

Accepted
Problem: There is a right triangle ABC with ∠ABC=90°.  Given the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.  It is guaranteed that the area of the triangle ABC is an integer.

Submission attempts (in order):
def f(a):
  if a%2 == 0:
    return a//2
  else:
    return 3*a+1

s = int(input())
a = [s]
i=2
 
while(True):
  a.append(f(a[i-2]))
  if a[i-1] in a[:i-1]:
    print(i)
    break
  i=i+1


a, b, _ = input().split()

print(int(a) * int(b) // 2)

Verdicts: Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s=int(input())
x=s
l=[]
for i in range(1000000):
    if x%2==0:
        l.append((x//2))
        x=x//2
        if l.count(x)==2:
            print(i+1)
            break
    else:
        l.append((3*x+1))
        x=3*x+1
        if l.count(x)==2:
            print(i+1)
            break

s=int(input())
x=s
l=[]
if x==1:
    print(4)
else:
    for i in range(1000000):
        if x%2==0:
            l.append((x//2))
            x=x//2
            if l.count(x)==2:
                print(i+1)
                break
        else:
            l.append((3*x+1))
            x=3*x+1

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
n=input()
A=[]
A.append(n)
for i in range(2,10**6):
  if n%2==0:
    n/=2
  else:
    n=3*n+1
  if n in A:
    print(i)
    exit()
  else:
    A.append(n)

n=int(input())
A=[]
A.append(n)
for i in range(2,10**6):
  if n%2==0:
    n/=2
  else:
    n=3*n+1
  if n in A:
    print(i)
    exit()
  else:
    A.append(n)


Verdicts: Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())

list_aaa = []

for i in range(1,100+1):
    if i ==1:
        list_aaa.append(s)
    elif s%2 ==0:
        s= s//2
        list_aaa.append(s)
    elif s%2 ==1:
        s= (3*s)+1
        list_aaa.append(s)
print(list_aaa)

for i in list_aaa:
    index_num = [n for n, v in enumerate(list_aaa) if v == i]
    if len(index_num) >=2:
        print(index_num[1]+1)
        break


s = int(input())

list_aaa = []

for i in range(1,100000+1):
    if i ==1:
        list_aaa.append(s)
    elif s%2 ==0:
        s= s//2
        list_aaa.append(s)
    elif s%2 ==1:
        s= (3*s)+1
        list_aaa.append(s)
#print(list_aaa)

for i in list_aaa:
    index_num = [n for n, v in enumerate(list_aaa) if v == i]
    if len(index_num) >=2:
        print(index_num[1]+1)
        break


Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s=int(input())
l=[s]
i=0
ans="False"
while ans=="True":
	if l[i]%2==0:
		l.append(l[i]//2)
		i+=1
		if l[i] in l[:i-1]:
			ans="True"
	else:
		l.append(l[i]*3+1)
		i+=1
		if l[i] in l[:i-1]:
			ans="True"
print(len(l))

s=int(input())
l=[s]
i=0
ans="False"
while ans=="False":
	if l[i]%2==0:
		l.append(l[i]//2)
		i+=1
		if l[i] in l[:i-1]:
			ans="True"
	else:
		l.append(l[i]*3+1)
		i+=1
		if l[i] in l[:i-1]:
			ans="True"
print(len(l))

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s=int(input())
l=[]
l.append(s)
ans=[]
c=1
for i in range(10000000000):
    if l[c-1]%2==0:
        l.append(int(l[c-1]/2))
    else:
        l.append(int(l[c-1]*3+1))
    for v in range(len(l)):
        ans.append(l.count(l[v]))
    if 2 in ans:
        break
    c+=1
print(c)

s=int(input())
l=[]
l.append(s)
ans=[]
c=1
for i in range(10000000000):
    if l[c-1]%2==0:
        l.append(int(l[c-1]/2))
    else:
        l.append(int(l[c-1]*3+1))
    for v in range(len(l)):
        ans.append(l.count(l[v]))
    if 2 in ans:
        break
    c+=1
print(c+1)


Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
def main():
    s = int(input())
    i = 1
    l = [i]
    flag = 0
    while flag == 0:
        if s % 2 == 0:
            s = s // 2
        else:
            s = 3*s + 1
        i += 1
        if s in l:
            print(i)
            return
        else:
            l.append(s)
main()  

def main():
    s = int(input())
    i = 1
    l = [s]
    flag = 0
    while flag == 0:
        if s % 2 == 0:
            s = s // 2
        else:
            s = 3*s + 1
        i += 1
        if s in l:
            print(i)
            return
        else:
            l.append(s)
main()  

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s=int(input())
l=[s]
a=s
for i in range(1000000):
      if a%2==0:
            a=int(a/2)
            l.append(a)
      else:
            a=3*a+1
            l.append(a)
            
      print(l)
      print(l.count(a))
      if l.count(a)==2:
            print(len(l))
            break


s=int(input())
l=[s]
a=s
for i in range(1000000):
      if a%2==0:
            a=int(a/2)
            l.append(a)
      else:
            a=3*a+1
            l.append(a)
            
      print(l)
      print(l.count(a))
      if l.count(a)==2:
            print(len(l))
            break


s=int(input())
l=[s]
a=s
for i in range(1000000):
      if a%2==0:
            a=int(a/2)
            l.append(a)
      else:
            a=3*a+1
            l.append(a)
      if l.count(a)==2:
            print(len(l))
            break


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
l = []
l.append(int(input()))
i = 0
while True:
  if s&2:
    l.append(3*l[i]+1)
  else:
    l.append(l[i]/2)
  i += 1
  for j in range(j,i):
    if l[j] == l[i]:
      break
print(i)

l = []
l.append(int(input()))
i = 0
key = 1
while key:
  if l[i]%2:
    l.append(3*l[i]+1)
  else:
    l.append(l[i]/2)
  i += 1
  for j in range(i-1):
    if l[j] == l[i]:
      key = 0
      print(i+1)
      break


Verdicts: Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())
L = set([s])
now = s
for i in range(1,1000000):
  if now%2 == 0:
    now = now // 2
  else:
    now = 3 * now + 1
  if now in L:
    print(s)
    break
  else:
    L.add(now)


s = int(input())
if s == 1 or s == 2:
    print(4)
    res = 1
else:
    while True:
        if s == 4:
            break
        else:
            if s % 2 == 0:
                s = s // 2
            else:
                s = 3 * s + 1
            res += 1

    print(res+3)

s = int(input())
L = set([s])
now = s
for i in range(1000000):
  if now%2 == 0:
    now = now // 2
  else:
    now = 3 * now + 1
  if now in L:
    print(s)
    break
  else:
    L.add(now)

s = int(input())
if s == 1 or s == 2:
    print(4)
    res = 1
    while True:
        if s == 4:
            break
        else:
            if s % 2 == 0:
                s = s // 2
            else:
                s = 3 * s + 1
            res += 1

    print(res+3)

s = int(input())
if s == 1 or s == 2:
    print(4)
else:
    res = 1
    while True:
        if s == 4:
            break
        else:
            if s % 2 == 0:
                s = s // 2
            else:
                s = 3 * s + 1
            res += 1

    print(res+3)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
lis=[int(input())]
for i in range(1000):
    if lis[i]%2==0:
        a=lis[i]//2
        lis.append(a)
        if a==lis[0]:
            break
    else:
        a=lis[i]*3+1
        lis.append(a)
        if a==lis[0]:
            break
            def has_duplicates(x):
                return len(x) != len(set(x))
            if has_duplicates(lis)==True:
                break
print(len(lis))

lis=[int(input())]
for i in range(1000):
    if lis[i]%2==0:
        a=lis[i]//2
        lis.append(a)
        def has_duplicates(x):
            return len(x) != len(set(x))
        if has_duplicates(lis)==True:
            break
    else:
        a=lis[i]*3+1
        lis.append(a)
        def has_duplicates(x):
            return len(x) != len(set(x))
        if has_duplicates(lis)==True:
            break
print(lis)
print(len(lis))

lis=[int(input())]
for i in range(1000):
    if lis[i]%2==0:
        a=lis[i]//2
        lis.append(a)
        def has_duplicates(x):
            return len(x) != len(set(x))
        if has_duplicates(lis)==True:
            break
    else:
        a=lis[i]*3+1
        lis.append(a)
        def has_duplicates(x):
            return len(x) != len(set(x))
        if has_duplicates(lis)==True:
            break
print(len(lis))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())
l = [-1] * 300
l[1] = s
for i in range(2,200):
    if i % 2 == 0:
        l[i] = l[i - 1] / 2
    else:
        l[i] = 3*l[i - 1] + 1

    print(str(i)+":"+str(l[i]))

    if l[i] in l[:i]:
        print(i)
        break


used = dict()
s = int(input())
cnt = 1
while True:
    if s in used:
        break
    cnt += 1
    used[s] = True
    if s&1==1:
        s = 3 * s + 1
    else:
        s = s//2
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())
count = 1
while True:
  dic = {s:1}
  if s % 2 == 0:
    s //= 2
  else:
    s = 3 * s + 1
  count += 1
  if s in dic.keys():
    dic[s] += 1
    print(count)
    break
  else:
    dic[s] = 1
    

s = int(input())
dic = {s:1}
count = 1
while True:
  if s % 2 == 0:
    s //= 2
  else:
    s = 3 * s + 1
  count += 1
  if s in dic.keys():
    dic[s] += 1
    print(count)
    break
  else:
    dic[s] = 1

Verdicts: Time Limit Exceeded

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = []
s.append(int(input()))
for i in range(1, 1000000):
	if s %2:
		s.append(3*s+1)
	else:
		s.append(s/2)
	for j in range(i):
		if s[j] == s[i]:
			print(i)

s = [int(input())]
for i in range(1000000):
	if s[i]%2==0:
		
		# print(s)
		if s[i]/2 in s:
			print(i+2)
			break
		s.append(s[i]/2)
	else:
		
		if 3*s[i]+1 in s:
			print(i+2)
			break
		s.append(3*s[i]+1)
	# print(s)


Verdicts: Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
from collections import Counter

s = int(input())
a = [s]
def f_even(n):
    return n//2
def f_odd(n):
    return 3*n + 1
for i in range(100):
    if a[i]%2 == 0:
        a.append(f_even(a[i]))
    else:
        a.append(f_odd(a[i]))
    tmp = Counter(a).most_common()[0]
    if tmp[1] > 1:
        print(i+2)
        return

s = int(input())
lst = []

while s not in lst:
    lst.append(s)
    s = s/2 if s%2==0 else 3*s + 1
    
print(len(lst) + 1)

Verdicts: Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())
a_list = [s]
INF = 10 ** 5
for i in range(INF):
    value = a_list[-1]
    if value % 2 == 0:
        next_value = value / 2
        if next_value in a_list:
            print(a_list)
            print(i + 2)
            break
        else:
            a_list.append(int(next_value))
    else:
        next_value = (3 * value) + 1
        if next_value in a_list:
            print(a_list)
            print(i + 2)
            break
        else:
            a_list.append(int(next_value))

s = int(input())
a_list = [s]
INF = 10 ** 5
for i in range(INF):
    value = a_list[-1]
    if value % 2 == 0:
        next_value = value / 2
        if next_value in a_list:
            print(i + 2)
            break
        else:
            a_list.append(int(next_value))
    else:
        next_value = (3 * value) + 1
        if next_value in a_list:
            print(i + 2)
            break
        else:
            a_list.append(int(next_value))

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())
 
ans=0
 
def f(n):
  if (n % 2 == 0):
    return n / 2
  else:
    return 3*n + 1
  
while (True):
  a_n = [s]
  for i in range(len(a_n)):
    a_i  = f(a_n.pop(-1))
    a_n.append(a_i)
    
print(ans)

s = int(input())

ans = 0

if (s == 1 || s == 2 || s == 4):
  print(4)

while (s != 4):
  if (s % 2 == 0):
    s /= 2
  else:
    s = 3*s + 1
  ans += 1

print(ans+4)


  

s = int(input())
 
ans=0
 
def f(n):
  if (n % 2 == 0):
    return n / 2
  else:
    return 3*n + 1
  
while (True):
  a_n = [s]
  for i in len(a_n):
    if (a_n.count(4) != 2):
      a_i = f(a_n.pop(-1))
      a_n.append(a_i)
    else:
      index = a_n.index(4)
      ans = a_n[index+3]
      break
    
print(ans)

s = int(input())

ans=0

def f(n):
  if (n % 2 == 0):
    return f(n /2)
  else:
    return f(3*n + 1)
  
while (True):
  a_n = [s]
  if (a_n.count(4) != 2):
    a_n.append(f(s))
  else:
    index = a_n.index(4)
    ans = a_n[index+3]
    break
    
print(ans)
  
  
  



s = int(input())
 
ans=0
 
def f(n):
  if (n % 2 == 0):
    return n / 2
  else:
    return 3*n + 1
  
while (True):
  a_n = [s]
  for i in range(len(a_n)):
    if (a_n.count(4) != 2):
      a_i = f(a_n.pop(-1))
      a_n.append(a_i)
    else:
      index = a_n.index(4)
      ans = a_n[index+3]
      break
    
print(ans)

s = int(input())
 
ans = 0
 
if (s == 1 or s == 2 or s == 4):
  print(4)
else:
  while (s != 4):
    if (s % 2 == 0):
      s  =  int(s/2)
    else:
      s = 3*s + 1
    ans += 1
  
 
  print(ans+4)


Verdicts: Time Limit Exceeded

Runtime Error

Runtime Error

Runtime Error

Time Limit Exceeded

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())

def f(n):
  if n%2:
    return n*3+1
  else:
    return n//2

i = 1
hist = {s:i}
while 1:
  s = f(s)
  if s in hist:
    print(i)
    break
  else:
    hist[s]= i
  i+=1

s = int(input())

def f(n):
  if n%2:
    return n*3+1
  else:
    return n//2

i = 1
hist = {s:i}
while 1:
  s = f(s)
  i+=1
  if s in hist:
    print(i)
    break
  else:
    hist[s]= i

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
a=int(input())
m={}
for i in range(1000000):
  if a in m:
    break
  m[a] = i
  if a %2==0:
    a //=2
  else:
    a = 3*a+1
print(m[a])


a=int(input())
m={}
for i in range(1000000):
  if a in m:
    print(i+1)
    break
  m[a] = i
  if a %2==0:
    a //=2
  else:
    a = 3*a+1


Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
colatz=[1,2,4]
colatz.append(int(input()))
if colatz[3]==2 or colatz[3]==4:
    print(4)
else:
    b=3
    while colatz[b]!=colatz[b-3]:
        if colatz[b]%2==0:
            colatz.append(colatz[b]/2)
        else: colatz.append(3*colatz[b]+1)
        b=b+1
    print(b+1)

colatz=[1,2,4]
colatz.append(int(input()))
b=3
while colatz[b]!=colatz[b-3]:
    if colatz[b]%2==0:
        colatz.append(colatz[b]/2)
    else: colatz.append(3*colatz[b]+1)
    b=b+1
print(b+1)

colatz=1,2,4
colatz.append(list(map(int,input().split())))
b=3
while colatz[b]!=colatz[b-3]:
    if colatz[b]%2==0:
        colatz.append(colatz[b]/2)
    else: colatz.append(3*colatz[b]+1)
    b=b+1
print(b)

colatz=[1,2,4]
colatz.append(int(input()))
if colatz[3]==1 or 2 or 4:
    print(4)
else:
    b=3
    while colatz[b]!=4:
        if colatz[b]%2==0:
            colatz.append(colatz[b]/2)
        else: colatz.append(3*colatz[b]+1)
        b=b+1
    print(b+1)

colatz=[1,2,4]
colatz.append(int(input()))
b=3
while colatz[b]!=colatz[b-3]:
    if colatz[b]%2==0:
        colatz.append(colatz[b]/2)
    else: colatz.append(3*colatz[b]+1)
    b=b+1
print(b)

colatz=[1,2,4]
colatz.append(int(input()))
if colatz[3]==1 or colatz[3]==2 or colatz[3]==4:
    print(4)
else:
    b=3
    while colatz[b]!=4:
        if colatz[b]%2==0:
            colatz.append(colatz[b]/2)
        else: colatz.append(3*colatz[b]+1)
        b=b+1
    print(b+1)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())
alist = [s]
aset=set()
for i in range(1000000):
  n = alist[-1]
  if n in aset:
    print(len(alist))
    break
  aset.add(n)
  if n%2 ==0:
    x = n//2
  else:
    x = 3*n+1
  alist.append(x)
print(alist)

s = int(input())
alist = [s]
aset=set()
for i in range(1000000):
  n = alist[-1]
  if n in aset:
    print(len(alist))
    break
  aset.add(n)
  if n%2 ==0:
    x = n//2
  else:
    x = 3*n+1
  alist.append(x)

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s=int(input())
i=0
a=[]
def f(n):
    a.append(n)
    print(a)
    if a[-3:]==[4,2,1]:
        print(len(a)+1)
        exit()
    if n%2==0:
        n=n//2
        f(n)
    else:
        n=3*n+1
        f(n)
f(s)

def f(n):
    if n%2==0:
        return n//2
    else:
        return 3*n+1

s=int(input())
a=[s]
for i in range(2,10**10):
    s=f(s)
    if s in a:
        print(i)
        exit()
    a.append(s)


Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = input()
def f(n):
  if n%2 == 0:
    return n/2
  else:
    return 3*n+1
a = []
a.append(s)
for i in range(1,1000001):
  if f(a[i-1]) in a:
    print(i)
    break
  else:
    a.append(f(a[i-1]))
  

s = int(input())
def f(n):
  if n%2 == 0:
    return n/2
  else:
    return 3*n+1
a = []
a.append(s)
for i in range(1,1000001):
  if f(a[i-1]) in a:
    print(i)
    break
  else:
    a.append(f(a[i-1]))
  

s = int(input())
def f(n):
  if n%2 == 0:
    return n/2
  else:
    return 3*n+1
a = []
a.append(s)
for i in range(1,1000001):
  if f(a[i-1]) in a:
    print(i+1)
    break
  else:
    a.append(f(a[i-1]))
  

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
def main():
    def f(n):
        return 3 * n + 1 if n % 2 else n // 2
    s = int(input())
    a = [s]
    for i in range(1, 11**6):
        x = f(a[i-1])
        if x in a:
            return len(a) + 1, a; exit()
        a.append(x)
    

print(main())

def main():
    def f(n):
        return 3 * n + 1 if n % 2 else n // 2
    s = int(input())
    a = [s]
    for i in range(1, 11**6):
        x = f(a[i-1])
        if x in a:
            return len(a) + 1; exit()
        a.append(x)


print(main())

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())
a = set([s])
p = s
n = 0
cnt = 0
while True:
  if n in a:
    print(cnt)
    exit()
  if p&1:
    n = 3*p +1
  else:
    n = p//2
  cnt += 1
  a.add(n)
  p = n


s = int(input())
a = set(s)
p = s
n = 0
cnt = 0
while True:
  if n in a:
    print(cnt)
    exit()
  if p&1:
    n = 3*p +1
  else:
    n = p//2
  cnt += 1
  set.add(n)
  p = n


s = int(input())
a = set([s])
p = s
n = 0
cnt = 1
while True:
  if n in a:
    print(cnt)
    exit()
  if p&1:
    n = 3*p +1
  else:
    n = p//2
  cnt += 1
  a.add(n)
  p = n


s = int(input())
a = set(s)
p = s
n = 0
cnt = 0
while True:
  if n in a:
    print(cnt)
    exit()
  if p&1:
    n = 3*p +1
  else:
    n = p//2
  cnt += 1
  a.add(n)
  p = n


s = int(input())
a = set([s])
p = s
n = 0
cnt = 1
while True:
  if n in a:
    print(cnt)
    exit()
  a.add(n)
  if p&1:
    n = 3*p +1
  else:
    n = p//2
  cnt += 1
  p = n


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
def f(n):
    
    if n % 2 == 0:
        return int(n / 2)
    else:
        return 3 * n + 1
 
if __name__ == "__main__":
    s = int(input())

    for m in range(0, 1000000): 
        if s == 4:
            print(m + 3)
            break
        s = f(s)

def f(n):
    
    if n % 2 == 0:
        return int(n / 2)
    else:
        return 3 * n + 1
 
if __name__ == "__main__":
    s = int(input())
    if s == 2 or s == 1:
        print(4)
        exit()
    for m in range(1, 1000000): 
        if s == 4:
            print(m + 3)
            break
        s = f(s)

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())

a = [s]
def f(n):
    if n % 2 == 0:
        return(n//2)
    else:
        return(3*n+1)

for i in range(1000001):
    if f(a[i]) in a:
        print(i+1)
        break
    a.append(f(a[i])

s = int(input())

a = [s]
def f(n):
    if n % 2 == 0:
        return(n//2)
    else:
        return(3*n+1)

for i in range(1000001):
    if f(a[i]) in a:
        print(i+1)
        break
    a.append(f(a[i])
    


s = input()
a = [s]
def f(n):
    if n % 2 == 0:
        return(n//2)
    else:
        return(3*n+1)
i = 0
while True:
    if f(a[i]) in a:
        print(i+1)
        break
    a.append(f(a[i])
    i += 1


s = int(input())

a = [s]
def f(n):
    if n % 2 == 0:
        return(n//2)
    else:
        return(3*n+1)

for i in range(1000001):
    if f(a[i]) in a:
        print(i+1)
        break
    a.append(f(a[i]))

s = int(input())

a = [s]
def f(n):
    if n % 2 == 0:
        return(n//2)
    else:
        return(3*n+1)

for i in range(1000001):
    if f(a[i]) in a:
        print(i+2)
        break
    a.append(f(a[i]))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())
k=[s]
i = 1
while 1:
	if k[-1]%2 == 0:
  		x = int(k[-1]/2)
	else:
  		x = 3*k[-1]+1
    if x in k:
      print(i+1)
      break
    else:
      k.append(x)
      i+=1

s = int(input())
k=[s]
i = 1
while 1:
	if k[-1]%2 == 0:
  		x = int(k[-1]/2)
	else:
  		x = 3*k[-1]+1
    if x in k:
        print(i+1)
        break
    else:
        k.append(x)
        i+=1

s = int(input())
k=[]
k.append(s)
i = 1
while 1:
	if k[-1]%2 == 0:
  		x = k[-1]/2
	else:
  		x = 3*k[-1]+1
    if x in k:
      print(i+1)
      break
    else:
      k.append(x)
      i+=1

s = int(input())
k=[s]
i = 1
while 1:
	if k[-1]%2 == 0:
  		x = int(k[-1]/2)
	else:
  		x = int(3*k[-1]+1)
    if x in k:
      print(i+1)
      break
    else:
      k.append(x)
      i+=1

s = int(input())
ans_list = [s]
i = 1
while 1:
    if ans_list[-1]%2 == 0:
        a = int(ans_list[-1]/2)
    else:
        a = 3 * ans_list[-1] + 1
    if a in ans_list:
        print(i+1)
        break
    else:
        ans_list.append(a)
        i += 1

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
n = int(input())
s = set()
s.append(n)
i = 1
while True:
  i += 1
  if n % 2 == 0:
    n = n / 2
  else:
    n = 3 * n + 1
  if n in s:
    print(i)
  s.add(n)

n = int(input())
s = set()
s.add(n)
i = 1
while True:
  i += 1
  if n % 2 == 0:
    n = n / 2
  else:
    n = 3 * n + 1
  if n in s:
    print(i)
    break
  s.add(n)


Verdicts: Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = int(input())
vals = []
vals += [s]
n=1
while True:
    if vals[n-1]%2==0:
        val = vals[n-1]/2
    else:
        val = vals[n-1]*3+1
        
    if val in vals:
        print(val)
        break
    else:
        vals += [val]
        n += 1

s = int(input())
vals = []
vals += [s]
n=1
while True:
    if vals[n-1]%2==0:
        val = vals[n-1]/2
    else:
        val = vals[n-1]*3+1
        
    if val in vals:
        print(len(vals)+1)
        break
    else:
        vals += [val]
        n += 1

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s=int(input())
arr=[s]
tmp=0
for i in range(m):
  if arr[i]%2==0:
    tmp=int(arr[i]/2)
  else:
    tmp=arr[i]*3+1
  if tmp in arr:
    print(i+1)
    break
  arr.append(tmp)
  

s=int(input())
arr=[s]
tmp=0
for i in range(10**6+1):
  if arr[i]%2==0:
    tmp=int(arr[i]/2)
  else:
    tmp=arr[i]*3+1
  if tmp in arr:
    print(i+2)
    break
  arr.append(tmp)

Verdicts: Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
def f(n):
  if N%2 == 0:
    return n //2
  return 3*n+1

s = int(input())
ans = 1
used = set()
while True:
  if s in used:
    break
  used.add(s)
  ans += 1
  s = f(s)
print(ans)

def f(n):
    if n%2 == 0:
        return n //2
    return 3*n+1

s = int(input())
ans = 1
used = set()

while True:
    if s in used:
        break
    used.add(s)
    ans += 1
    s = f(s)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
from collections import defaultdict
d = defaultdict(int)
a = int(input())
d[a] += 1

for i in range(10**6):
    a = a//2 if (a%2 == 0) else a*3+1
    d[a] += 1
    if (d[a] > 1):
        print(i+2)
        print(d)
        break



from collections import defaultdict
d = defaultdict(int)
a = int(input())
d[a] += 1

for i in range(10**6):
    a = a//2 if (a%2 == 0) else a*3+1
    d[a] += 1
    if (d[a] > 1):
        print(i+2)
        break



Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = map(int,input().split())
i = 1
r = [s]
while True:
  i += 1
  s = s // 2 if s % 2 == 0 else 3 * s + 1
  if s in r:
    print(i)
    break
  r += [s]

s = int(input())
i = 1
r = [s]
while True:
  i += 1
  s = s // 2 if s % 2 == 0 else 3 * s + 1
  if s in r:
    print(i)
    break
  r += [s]


Verdicts: Runtime Error

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
s = str(input())

for i in range(1, len(s)):
  if s[i-1] == s[i]:
    print('Bad')
    exit()
else:
  print('Good')

 

s = int(input())
a = s
i = 1
s_ = set()
s_.add(a)
while True:
  i += 1
  if a%2 == 0:
    a = a//2
  else:
    a = 3*a+1
  if a in s_:
    print(i)
    exit()
  else:
    s_.add(a)

Verdicts: Wrong Answer

Accepted
Problem: A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:    * The first term s is given as input.    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.  Find the minimum integer m that satisfies the following condition:    * There exists an integer n such that a_m = a_n (m > n).

Submission attempts (in order):
import sys
s = int(input())
if not ( 1 <= s <= 100 ): sys.exit()
array = [s]

for I in range(1,10 ** 6 + 1):
    if array[ I - 1 ] % 2 == 0:
        if array[I - 1]//2 in array:
            print(I)
            sys.exit()
        array.append(array[(I - 1)]//2)     
    else:
        if (3 * array[I - 1]) + 1 in array:
            print(I)
            sys.exit()
        array.append((3 * array[(I - 1)]) + 1)


import sys
s = int(input())
if not ( 1 <= s <= 100 ): sys.exit()
array = [s]

for I in range(1,10 ** 6 + 1):
    print(array)
    if array[ I - 1 ] % 2 == 0:
        if array[I - 1]//2 in array:
            print(I)
            sys.exit()
        array.append(array[(I - 1)]//2)     
    else:
        if (3 * array[I - 1]) + 1 in array:
            print(I)
            sys.exit()
        array.append((3 * array[(I - 1)]) + 1)


import sys
s = int(input())
if not ( 1 <= s <= 100 ): sys.exit()
array = [s]

for I in range(1,10 ** 6 + 1):
    if array[ I - 1 ] % 2 == 0:
        if array[I - 1]//2 in array:
            print(I + 1)
            sys.exit()
        array.append(array[(I - 1)]//2)     
    else:
        if (3 * array[I - 1]) + 1 in array:
            print(I + 1)
            sys.exit()
        array.append((3 * array[(I - 1)]) + 1)


Verdicts: Wrong Answer

Wrong Answer

Accepted