Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03698 (python)

Fixed submission:
s = input()
s_set = set(s)
f = True
for i in s_set:
  if s.count(i) >= 2:
      f = False
      break
if f:
  print("yes")
else:
  print("no")

Buggy submission (verdict: Runtime Error):
s = input()
s_set = set(s)
f = True
for i in s_set:
  if s.count(i) >= 2:
    f = False
  	break
if f:
  print("Yes")
else:
  print("No")
Problem p03729 (python)

Fixed submission:
s = list(input().split())
if s[0][-1] == s[1][0] and s[1][-1] == s[2][0]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
s = list(input().split())
if s[0].offset(-1) == s[1].offset(0) and s[1].offset(-1) == s[2].offset(0):
  print("YES")
else:
  print("NO")
Problem p03760 (python)

Fixed submission:
s = input()
t = input()
for i in range (len(s)+len(t)):
    if i % 2 == 0: 
        print(s[i//2],end="")
    else:
        print(t[i//2],end="")

Buggy submission (verdict: Runtime Error):
s = input()
r = input()
for i in range (len(s)+len(t)):
    if i % 2 == 0: 
        print(s[i//2],end="")
    else:
        print(t[i//2],end="")
Problem p03773 (python)

Fixed submission:
A, B = map(int,input().split())
if A + B >= 24:
  print(A + B -24)
else:
  print(A + B)

Buggy submission (verdict: Runtime Error):
A, B = int(input().split())
if A + B > 24:
  print(A + B -24)
else:
  print(A + B)
Problem p03777 (python)

Fixed submission:
a , b = input().split()
if a == b:
  print("H")
else:
  print("D")

Buggy submission (verdict: Runtime Error):
a , b = input().split()
if a == b:
  print("H"):
else:
  print("D")
Problem p04044 (python)

Fixed submission:
n,l = map(int,input().split())
s = []
for i in range(n):
    s.append(input())
s.sort()
print(*s,sep="")

Buggy submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = []
for i in range(l):
    s.append(input())
s.sort()
print(*s,sep="")
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())

if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()

if a * b % 2 == 0:
  print('Even')
else:
  print('Odd')
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split(None, 2))

print(a+b+c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split(None, 2)

print(a+b+c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

print(a+b+c)
Problem p02934 (python)

Fixed submission:
N = int(input())
 
A = map(int,input().split())

A = [1/a for a in A]

print(1/sum(A))

Buggy submission (verdict: Runtime Error):
N = int(input())

A = int(input().split())

b = sum(reverse(a)) for a in A

print(sum(severse(b)))
Problem p02946 (python)

Fixed submission:
line = input().split()
K = int(line[0])
X = int(line[1])

ans = list(range(X-K+1,X+K))
print(' '.join(map(str,ans)))

Buggy submission (verdict: Runtime Error):
import numpy as np
firstline=input().split()
K=int(firstline[0])
X=int(firstline[1])
blackstone=np.arange(X-K+1,X+K)
array_info(blackstone)
Problem p02910 (python)

Fixed submission:
if __name__ == "__main__":
  inputstr = input()
  size = len(inputstr)
  isEasy = True

  for i in range(size):
    point = i + 1
    if point % 2 == 0:
      if inputstr[i] in ["L", "U", "D"]:
        pass
      else:
        isEasy = False
        break
    else:
      if inputstr[i] in ["R", "U", "D"]:
        pass
      else:
        isEasy = False
        break

  if isEasy == True:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
  inputstr = input()
  size = len(inputstr)

  isEasy = True

  for i in range(size):
    if i % 2 == 0:
      if inputstr[i] in ["R", "U", "D"]:
      else:
        isEasy = False
        break
    else:
      if inputstr[i] in ["L", "U", "D"]:
      else:
        isEasy = False
        break

  if isEasy = True:
    print("Yes")
  else:
    print("No")
Problem p02923 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

li = []
cnt = 0
c = a[0]
if n >= 2:
	for i in range(1,n):
		# print(c)
		if c >= a[i]:
			cnt += 1
			c = a[i]
		else:
			li.append(cnt)
			c = a[i]
			cnt = 0
		
		if i == n-1:
			li.append(cnt)
else:
	li.append(0)



print(max(li))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

li = []
cnt = 0
c = a[0]

for i in range(1,n):
	# print(c)
	if c >= a[i]:
		cnt += 1
		c = a[i]
	else:
		li.append(cnt)
		c = a[i]
		cnt = 0
	
	if i == n-1:
		li.append(cnt)

print(max(li))
Problem p02999 (python)

Fixed submission:
x ,a =  map(int, input().split())
if x < a:
	print(0)
else:
	print(10)

Buggy submission (verdict: Runtime Error):
x ,a =  map(int, input().split())
if x < a:
	print(0)
elif:
	print(10)
Problem p03024 (python)

Fixed submission:
a = input()
x = [a[i:i+1] for i in range(len(a))]
r = len([s for s in x if s.endswith('x')])
if r >= 8:
	print('NO')
else:
	print('YES')

Buggy submission (verdict: Runtime Error):
a = input()
x = [a[i:i+1] for i in range(len(a))]
r = len([s for s in l if s.endswith('x')])
if r >= 8:
	print('NO')
else:
	print('YES')
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().split())
X = 0
if A > 12:
	X = B
elif A > 5:
	X = int(B/2)
elif A < 6:
	X = 0

print(X)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
X = 0
if A >= 13:
	X = B
elif A < 13 AND A >= 6:
	X = B/2

print(X)
Problem p03061 (python)

Fixed submission:
def gcd(a,b):
  while b:a,b=b,a%b
  return a
n,a,b=int(input()),list(map(int,input().split())),[]
if n==2:print(max(a[0],a[1]))
elif n==3:print(max(gcd(a[0],a[1]),gcd(a[0],a[2]),gcd(a[1],a[2])))
else:
  no,mi=a[0],a[0]
  for i in range(1,n):
    s=gcd(no,a[i])
    if s!=no:
      no=max(s,mi)
      mi=gcd(s,mi)
  print(no)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
b = []

def gcd(a,b):
	while b:
		a, b = b, a % b
	return a
if n == 2:
	print(max(l[0],l[1]))
elif n == 3:
	print(max(gcd(l[0],l[1]),gcd(l[0],l[2]),gcd(l[2],l[1])))
else:
	for i in range(n):
		tmp = l
		tmp.pop(i)
		x = gcd(tmp[0],tmp[1])
		for j in list(range(2, n-1)):
			x = gcd(x,tmp[j])
		b.append(x)
	print(max(b))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
b = []

def gcd(a,b):
	while b:
		a, b = b, a % b
	return a
if n == 1:
	print(l[0])
elif n == 2:
	print(gcd(l[0],l[1]))
elif n == 3:
	print(max(gcd(l[0],l[1]),gcd(l[0],l[2]),gcd(l[2],l[1])))
else:
	for i in range(n):
		tmp = l
		tmp.pop(i)
		x = gcd(tmp[0],tmp[1])
		for j in list(range(2, n-1)):
			x = gcd(x,tmp[j])
		b.append(x)
	print(max(b))
Problem p02999 (python)

Fixed submission:
X, A = map(int, input().split())
if X < A:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
ans = 0
me_x = 0
me_y = 0
total = W * H
# (W - x) * H
if (W - x) > x:
  me_x = x * H
else:
  me_x = (W - x) * H

if (H - y) > y:
  me_y = y * W
else:
  me_y = (H - y) * W

if me_x > me_y:
  me_ans = me_x
else:
  me_ans = me_y

if me_x == (total - me_y):
  ans = 1
elif me_y == (total - me_x):
  ans = 1

if me_x == me_y:
  ans = 1
print(me_ans, ans)
Problem p02909 (python)

Fixed submission:
a=["Sunny", "Cloudy", "Rainy"]

S=input()

def func1(lst, value):
    return [i for i, x in enumerate(lst) if x == value]
  
idx=func1(a,S)[0]

if idx==2:
  ans=0
else:
  ans=idx+1

print(a[ans])

Buggy submission (verdict: Runtime Error):
S=input()

def func1(lst, value):
    return [i for i, x in enumerate(lst) if x == value]
  
idx=func1(a,S)[0]

if idx==2:
  ans=0
else:
  ans=idx+1

print(a[ans])
Problem p02921 (python)

Fixed submission:
S=list(input())
T=list(input())

k=0
for i in (range(3)):
  if S[i]==T[i]:
    k=k+1

print(k)

Buggy submission (verdict: Runtime Error):
N = int(input())
H= [int(s) for s in input().split()]

#print(N,H)

t=0
k=0

for i in range(1,N):
#  print("i="+str(i))
  if H[i]-H[i-1]<=0:
    k=k+1
#    print("k="+str(k))
    if k > t:
      t=k
#      print("t="+str(t))
  else:
    k=0
    continue
    
print(k)
Problem p02909 (python)

Fixed submission:
today = input()
li = ['Sunny', 'Cloudy', 'Rainy']
index = li.index(today)


def next_index(idx):
    if index == 2:
        return 0
    else:
        return idx + 1


print(li[next_index(index)])

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
nlist = [0 for i in range(n)]

for i in range(q):
    nlist[int(input())-1] += 1

for n in nlist:
    if q - n < k:
        print('Yes')
    else:
        print('No')
Problem p02921 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sys import stdin
import math

# 標準入力をスペースで区切って、intに変換 listに収納
S = stdin.readline()
T = stdin.readline()

cnt=0
for i in range(3):
    if S[i] == T[i]:
        cnt+=1


print(cnt)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
from sys import stdin
import math
 
# 標準入力をスペースで区切って、intに変換 listに収納
#int_list  = [int(x) for x in stdin.readline().rstrip().split()]
N = int(input())
 
total = int(N*(N-1)/2)
print(total)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sys import stdin
import math

# 標準入力をスペースで区切って、intに変換 listに収納
int_list  = [int(x) for x in stdin.readline().rstrip().split()]

N = int_list[0]


total = int(N*(N-1)/2)
print(total)
Problem p02937 (python)

Fixed submission:
slist = input()
tlist = input()
scounter = 0
slength=len(slist)
slist=slist+slist
preposition=-1
for tchar in tlist:
    preposition=slist.find(tchar, preposition+1)
    if preposition==-1:
        scounter=-1
        break
    elif preposition>=slength:
        scounter+=slength
        preposition-=slength
    # print(tchar, scounter, preposition)
if (scounter==-1):
    print(scounter)
else:
    print(scounter+preposition+1)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()

slist=list(s)
tlist=list(t)
#番兵設定
slist.append("aa")
scounter=0

for tchar in tlist:
  for schar in slist:
    #sを探してもない文字だった場合
    if schar =="aa":
      scounter=-1
      break
    if tchar==schar:
      break
    scounter+=1
    
  if scounter==-1:
    break
    
print(scounter)


while endflag==False:
  if
Problem p03067 (python)

Fixed submission:
A, B, C = ( int(i) for i in input().split() )

if A <= C <= B:
  print('Yes')
elif B <= C <= A:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

a = 0
for i in range(N):
  if S[i] == '.':
    a += 1

print(min(a, N-a))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

a = 0
b = 0

for i in range(N):
  if S[i] == '.':
    a += 1
  else:
    b += 1

print(min(a, b))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

a = 0
b = 0

for i in range(N):
  if S[i] == '.':
    a += 1
  else:
    b += 1

print(min(a, b))
Problem p03125 (python)

Fixed submission:
A, B = map(int, input().split())

if B % A == 0:
  print(A+B)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A, B = map(int, imput().split())

if B % A == 0:
  print(A+B)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A, B = map(int, imput().split())

if A/B == 0:
  print(A+B)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A = imput()
B = imput()

if B % A == 0:
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
A = imput()
B = imput()

if A/B == 0:
  print(A+B)
else:
  print(A-B)
Problem p03126 (python)

Fixed submission:
N, M = map(int, input().split())
A_list = [[int(i) for i in input().split()] for n in range(N)] 

A_list[0].pop(0)
a = A_list[0]
for i in range(1, N):
  A_list[i].pop(0)
  a = set(a) & set(A_list[i])

if len(a)==0:
  print(0)
else:
  print(len(a))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A_list = [[int(i) for i in input().split()] for i in range(N)] 

a = A_list[0].pop(0)
for i in range(1, N):
  a = set(a) & set(A_list[i].pop(0))

if len(a)==0:
  print(0)
else:
  print(a)
Problem p03219 (python)

Fixed submission:
X, Y = map(int, input().split())

print(X+(Y//2))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
data = [[int(i) for i in input().split()] for m in range(M)]
  
corresp = {}
for n in range(1, N+1):
    data_n = []
    for i in range(M):
        if data[i][0] == n:
            data_n.append(data[i])
    sort_n = sorted(data_n, key=lambda data_n_i: data_n_i[1])
    for k in range(len(sort_n)):
        corresp.update({str(sort_n[k]):k+1})
    

for i in range(M):
    print('{0:012d}'.format(data[i][0]*100000+corresp[str(data[i])]))

Buggy submission (verdict: Runtime Error):

N, M = map(int, input().split())
data = [[int(i) for i in input().split()] for i in range(M)]
  
corresp = {}
for n in range(1, N+1):
    data_n = []
    for i in range(M):
        if data[i][0] == n:
            data_n.append(data[i])
    sort_n = sorted(data_n, key=lambda data_n_i: data_n_i[1])
    for k in range(len(sort_n)):
        corresp.update({str(sort_n[k]):k+1})
    

for i in range(M):
    print('{0:012d}'.format(data[i][0]*100000+corresp[str(data[i])]))

Buggy submission (verdict: Runtime Error):

N, M = map(int, input().split())
data = []
for m in range(M):
  data.append(list(map(int, input().split())))

corresp = {}
for n in range(1, N+1):
    data_n = []
    for i in range(M):
        if data[i][0] == n:
            data_n.append(data[i])
    sort_n = sorted(data_n, key=lambda data_n_i: data_n_i[1])
    for k in range(len(sort_n)):
        corresp.update({str(sort_n[k]):k+1})
    

for i in range(M):
    print('{0:012d}'.format(data[i][0]*100000+corresp[str(data[i])]))

Buggy submission (verdict: Runtime Error):

N, M = map(int, input().split())
data = []
for m in range(M):
  data.append(map(int, input().split()))
  
corresp = {}
for n in range(1, N+1):
    data_n = []
    for i in range(M):
        if data[i][0] == n:
            data_n.append(data[i])
    sort_n = sorted(data_n, key=lambda data_n_i: data_n_i[1])
    for k in range(len(sort_n)):
        corresp.update({str(sort_n[k]):k+1})
    

for i in range(M):
    print('{0:012d}'.format(data[i][0]*100000+corresp[str(data[i])]))

Buggy submission (verdict: Runtime Error):
X, Y = map(int(), input().split())

print(X+Y/2)
Problem p03220 (python)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

num = 0
for i in range(N):
  deff = abs(T-H[i]*0.006-A)
  if deff < abs(T-H[num]*0.006-A):
    num = i

print(num+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input.split())
H = [map(int, input.split())]

num = 0
for i in range(N):
  deff = abs(T-H[i]*0.006-A)
  if deff < abs(T-H[num]*0.006-A):
    num = i

print(num+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input.split())
H = list(map(int, input.split()))

num = 0
for i in range(N):
  deff = abs(T-H[i]*0.006-A)
  if deff < abs(T-H[num]*0.006-A):
    num = i

print(num)

Buggy submission (verdict: Runtime Error):
N = input()
T, A = map(int, input.split())
H = list(map(int, input.split()))

num = 0
for i in range(0, N):
  deff = abs(T-H[i]*0.006-A)
  if deff < abs(T-H[num]*0.006-A):
    num = i

print(num)
Problem p03860 (python)

Fixed submission:
X=input()
print(X[0]+X[8]+X[-7])

Buggy submission (verdict: Runtime Error):
x=input()
print(X[0],X[8],X[10])
Problem p04043 (python)

Fixed submission:
w=str(input())
if w.count("5")==2 and w.count("7")==1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
w=str(input())
if w.count("5")=2 and w.count("7")=1:
  print("YES")
else:
  print("NO")
Problem p02957 (python)

Fixed submission:
#入力
A = input().split()

#A,B ＝　数値化　M,m　＝　初期化
A[0] = int(A[0])
A[1] = int(A[1])
m = 0

#K探し
m = ( A[0] + A[1] ) / 2

#K判定
if m.is_integer():
    print( '%d' %m)
else :
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
#入力
A = input()
B = input()

#A,B ＝　数値化　M,m　＝　初期化
A = int(A)
B = int(B)
m = 0

#K探し
m = ( A + B ) / 2

#K判定および表示
if m.is_integer():
    print( '%d' %m)
else :
    print('IMPOSSIBLE')
Problem p02910 (python)

Fixed submission:
#!/usr/bin/env python3

S = input()
if S[0::2].find('L') == -1 and S[1::2].find('R') == -1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

N = int(input())
H = list(map(int, input().split()))
D = [0, abs(H[1] - H[0])]
for i in range(2, N):
    D.append(min(abs(H[i] - H[i - 1]) + D[i - 1], abs(H[i] - H[i - 2]) + D[i - 2]))
print(D[-1])
Problem p02995 (python)

Fixed submission:
from fractions import gcd
#[N,K] = list(map(int,input().split()))
#A = list(map(int,input().split()))
#[A,B,C,D] = list(map(int,input().split()))
[A,B,C,D] = list(map(int,input().split()))
def lcm(x, y):
    return (x * y) // gcd(x, y)
x_c = (B//C) - ((A-1)//C)
x_d = (B//D) - ((A-1)//D)
x_cd = (B//lcm(C,D)) - ((A-1)//lcm(C,D))
ans = (B - A + 1) - (x_c + x_d -x_cd)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
#[N,K] = list(map(int,input().split()))
#A = list(map(int,input().split()))
#[A,B,C,D] = list(map(int,input().split()))
[A,B,C,D] = list(map(int,input().split()))
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
x_c = (B//C) - ((A-1)//C)
x_d = (B//D) - ((A-1)//D)
x_cd = (B//lcm(C,D)) - ((A-1)//lcm(C,D))
ans = (B - A + 1) - (x_c + x_d -x_cd)
print(ans)
Problem p03006 (python)

Fixed submission:
#[R,G,B,N] = list(map(int,input().split()))
import collections
N = int(input())
xy = [tuple(map(int,input().split())) for i in range(N)]
xy.sort( key = lambda x: (x[0],x[1]))
l = []
for i in range(N):
    for j in range(i+1,N):
        (x_diff, y_diff) = [xy[i][0]-xy[j][0],xy[i][1]-xy[j][1]]
        l.append((x_diff, y_diff))
dic = collections.Counter(l)
val = dic.values()
if len(val) == 0:
    print(1)
else:
    print(N - max(val))

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
xy = [tuple(map(int,input().split())) for i in range(N)]
xy.sort( key = lambda x: (x[0],x[1]))
l = []
for i in range(N):
    for j in range(i+1,N):
        (x_diff, y_diff) = [xy[i][0]-xy[j][0],xy[i][1]-xy[j][1]]
        l.append((x_diff, y_diff))
dic = collections.Counter(l)
val = dic.values()
print(N - max(val))

Buggy submission (verdict: Runtime Error):
#[R,G,B,N] = list(map(int,input().split()))
import collections
N = int(input())
xy = [tuple(map(int,input().split())) for i in range(N)]
xy.sort( key = lambda x: (x[0],x[1]))
l = []
for i in range(N):
    for j in range(i+1,N):
        (x_diff, y_diff) = [xy[i][0]-xy[j][0],xy[i][1]-xy[j][1]]
        l.append((x_diff, y_diff))
dic = collections.Counter(l)
val = dic.values()
print(N - max(val))
Problem p03059 (python)

Fixed submission:
#[A,B,T] = [20,20,19]
[A,B,T] = list(map(int,input().split()))
print((T // A)*B)

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;



int main(){
    //input    
    int A,B,T;
    cin >> A >> B >> T;
    int ans;
    ans = (T / A)*B;
    cout << ans << endl;
    

    return 0;
}
Problem p03068 (python)

Fixed submission:
N = int(input())
S = str(input())
K = int(input())
#N = 5
#S = "error"
S = list(S)
#K = 2
char = S[K-1]
for i in range(len(S)):
    if S[i] != char:
        S[i] = "*"
print(''.join(S))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
K = int(input())
#N = 5
#S = "error"
S = list(S)
#K = 2
char = S[K]
for i in range(len(S)):
    if S[i] != char:
        S[i] = "*"
print(''.join(S))
Problem p03493 (python)

Fixed submission:
N = 1
data = []
for i in range(N):
    data_input = list(map(int,input().split()))
    data.append(data_input)
data = data[0][0]
ans=0
for i in range(3):
    k=2-i
    ans += data // (10**k)
    data = data % (10**k)
    
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6) 
N = int(input())
data = list(map(int,input().split()))
res = 0
while (True):
    exist_odd: bool = False
    for i in range(N):
        if data[i]%2 == 1:
            exist_odd = True
    if exist_odd == True:
        break
        
    for i in range(N):
        data[i] = data[i]//2
    
    res += 1
        
print(res)
Problem p03494 (python)

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
data = list(map(int,input().split()))
res = 0
exist_odd: bool = False
while exist_odd == False:
    for i in range(N):
        if data[i]%2 == 1:
            exist_odd = True
    
    if exist_odd == True:
            break
        
    for i in range(N):
        data[i] = data[i]//2
    
    res += 1
    
print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
data = list(map(int,input().split()))
res = 0
exist_odd: bool = False
while exist_odd == False:
    for i in range(N):
        if data[i]%2 == 1:
            exist_odd = True
    
    if exist_odd == True:
            break
        
    for i in range(N):
        data[i] = data[i]//2
    
    res += 1
    
print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
data = list(map(int,input().split()))
remain = [0]*N
res = 0
while max(remain) == 0:
    exist_odd: bool = False
    for i in range(N):
        if data[i]%2 == 1:
            exist_odd = True
    if exist_odd == True:
        break
        
    for i in range(N):
        data[i] = data[i]//2
    
    res += 1
        
print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
data = list(map(int,input().split()))
res = 0
while (True):
    exist_odd: bool = False
    for i in range(N):
        if data[i]%2 == 1:
            exist_odd = True
        if data[i] == 0:
            exist_odd = True
    if exist_odd == True:
        break
        
    for i in range(N):
        data[i] = data[i]//2
    
    res += 1
        
print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
data = list(map(int,input().split()))
res = 0
while (True):
    exist_odd: bool = False
    for i in range(N):
        if data[i]%2 == 1:
            exist_odd = True
    if exist_odd == True:
        break
        
    for i in range(N):
        data[i] = data[i]//2
    
    res += 1
        
print(res)
Problem p02971 (python)

Fixed submission:
from sys import stdin

readline = stdin.readline


def nf():
    """
    入力全て(EOFまで)を`int iter`に変換
    """
    return map(int, open(0).read().split())


def main():
    n, *al = nf()
    s, f = sorted(al)[-2:]
    if s == f:
        for _ in range(n):
            print(f)
        return
    for a in al:
        if a == f:
            print(s)
            continue
        print(f)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import stdin

readline = stdin.readline


def nf():
    """
    入力全て(EOFまで)を`int iter`に変換
    """
    return map(int, open(0).read().split())


def main():
    n, *l = nf()
    al = list(l)
    for i in range(n):
        ma = max([*al[:i], *al[i+1:]])
        print(ma)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
from sys import stdin

readline = stdin.readline


def ns():
    """
    入力を`[\\s]`を除いて文字列として取得
    """
    return readline().rstrip()


def ni():
    """
    入力を`int`に変換
    """
    return int(ns())


def nf():
    """
    入力全て(EOFまで)を`int iter`に変換
    """
    return map(int, open(0).read().split())


def main():
    n = ni()
    a = list(nf())
    for i in range(n):
        tmp = a[:]
        tmp.pop(i)
        print(max(tmp))


if __name__ == "__main__":
    main()