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

Fixed submission:
N = int(input())
S = str(input())
K = int(input())
ans = ""
for i in range(0, N):
    if(S[i] != S[K-1]):
        ans += "*"
    else:
        ans += S[K-1]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
K = int(input())
ans = ""
for i in range(0, N):
    if(S[i] != S[K]):
        ans += "*"
    else:
        ans += S[K]
print(ans)
Problem p03246 (python)

Fixed submission:
from collections import Counter

N = int(input())
V = tuple(map(int, input().split()))
X, Y = Counter(), Counter()
for i in range(0, N):
    if i & 1:
        Y[V[i]] += 1
    else:
        X[V[i]] += 1
if len(X) != 1:
    x = sorted(X.items(), reverse=True, key=lambda x: x[1])[:2]
else:
    x = sorted(X.items(), reverse=True, key=lambda x: x[1])[:1]
if len(Y) != 1:
    y = sorted(Y.items(), reverse=True, key=lambda x: x[1])[:2]
else:
    y = sorted(Y.items(), reverse=True, key=lambda x: x[1])[:1]
if x[0][0] == y[0][0]:
    ans = N
    tmp = 0
    if len(y) == 1:
        for i in range(0, N):
            if i & 1:
                if V[i] != y[0][0]+1:
                    tmp += 1
            else:
                if V[i] != x[0][0]:
                    tmp += 1
    else:
        for i in range(0, N):
            if i & 1:
                if V[i] != y[1][0]:
                    tmp += 1
            else:
                if V[i] != x[0][0]:
                    tmp += 1
    ans = min(ans, tmp)
    tmp = 0
    if len(x) == 1:
        for i in range(0, N):
            if i & 1:
                if V[i] != y[0][0]:
                    tmp += 1
            else:
                if V[i] != x[0][0]+1:
                    tmp += 1
    else:
        for i in range(0, N):
            if i & 1:
                if V[i] != y[0][0]:
                    tmp += 1
            else:
                if V[i] != x[1][0]:
                    tmp += 1
    ans = min(ans, tmp)
else:
    ans = 0
    for i in range(0, N):
        if i & 1:
            if V[i] != y[0][0]:
                ans += 1
        else:
            if V[i] != x[0][0]:
                ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
V = tuple(map(int, input().split()))
X, Y = Counter(), Counter()
for i in range(0, N):
    if i & 1:
        Y[V[i]] += 1
    else:
        X[V[i]] += 1
x = sorted(X.items(), reverse=True, key=lambda x: x[1])[:2]
y = sorted(Y.items(), reverse=True, key=lambda x: x[1])[:2]
if x[0][0] == y[0][0]:
    ans = N
    tmp = 0
    for i in range(0, N):
        if i & 1:
            if V[i] != y[1][0]:
                tmp += 1
        else:
            if V[i] != x[0][0]:
                tmp += 1
    ans = min(ans, tmp)
    tmp = 0
    for i in range(0, N):
        if i & 1:
            if V[i] != y[0][0]:
                tmp += 1
        else:
            if V[i] != x[1][0]:
                tmp += 1
    ans = min(ans, tmp)
else:
    ans = 0
    for i in range(0, N):
        if i & 1:
            if V[i] != y[0][0]:
                ans += 1
        else:
            if V[i] != x[0][0]:
                ans += 1
print(ans)
Problem p03282 (python)

Fixed submission:
S = str(input())
K = int(input())
for i in range(0, K):
    if S[i] != "1":
        print(S[i])
        exit()
print(1)

Buggy submission (verdict: Runtime Error):
S = str(input())
K = int(input())
if S.count("1") == S(len):
    print(1)
    exit(0)
for s in S:
    if s != "1":
        print(s)
        exit()
Problem p03292 (python)

Fixed submission:
A = map(int, input().split())
A = sorted(A)
ans = 0
for i in range(1, 3):
    ans += abs(A[i - 1] - A[i])
print(ans)

Buggy submission (verdict: Runtime Error):
A = map(int, input())
A = sorted(A)
ans = 0
for i in range(1, 3):
    ans += abs(A[i - 1] - A[i])
print(ans)
Problem p03385 (python)

Fixed submission:
S = str(input())
if not(S[0] == S[1]) and not(S[1] == S[2]) and not(S[0] == S[2]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = str(input())
ans = {}
ans.add(S[0])
ans.add(S[1])
ans.add(S[2])
if len(ans) == 3:
    print("Yes")
else:
    print("No")
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
ans = ["Even", "Odd"]
print(ans[(a * b) % 2])

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = [0, 1]
print(ans[(a + b) / 2])
Problem p03485 (python)

Fixed submission:
a, b = map(float, input().split())
if int((a + b) / 2) < ((a + b) / 2):
    print(int((a + b) / 2) + 1)
else:
    print(int((a + b) / 2))

Buggy submission (verdict: Runtime Error):
a, b = map(float, input().split())
print(int(round((a + b) / 2), 0))
Problem p03597 (python)

Fixed submission:
N = int(input())
A = int(input())
print(N ** 2 - A)

Buggy submission (verdict: Runtime Error):
N, A = map(int, input().split())
print(N**2-A)

Buggy submission (verdict: Runtime Error):
N, A = map(int, input().split())
print(N ** 2 - A)

Buggy submission (verdict: Runtime Error):
N, A = map(int, input().split())
print(N ** 2 - A)

Buggy submission (verdict: Runtime Error):
N, A = map(int, input().split())
print(N ** 2 - A)
Problem p03701 (python)

Fixed submission:
N = int(input())
A = []
ans = 0
for i in range(0, N):
    A.append(int(input()))
    ans += A[i]
A.sort()
if (ans % 10) != 0:
    print(ans)
else:
    s = [a for a in A if a % 10 != 0]
    if len(s) == 0:
        print(0)
    else:
        print(ans-s[0])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
ans = 0
for i in range(0, N):
    A.append(int(input()))
    ans += A[i]
A.sort()
if (ans % 10) != 0:
    print(ans)
else:
    s = [a for a in A if a % 10 != 0]
    print(ans-s[0])
Problem p03494 (python)

Fixed submission:
#-*- coding: utf-8 -*-

#関数は気持ち上に書いておきたい
def check_num():
    for i in range(N):
        if A[i] % 2 != 0:
            return False
        else:
            A[i] = A[i] / 2
    return True

if __name__ == '__main__':
    N = int(input())

    A = list(map(int, input().split()))
    ans = 0 #counterと同じ

    #check_num == Trueの間実行する
    while True:
        if check_num() == False:
            break
        ans += 1

    print(str(ans))

Buggy submission (verdict: Runtime Error):
#-*- coding: utf-8 -*-

#関数は気持ち上に書いておきたい
def check_num():
    for i in range(N):
        if A[i] % 2 != 0:
            return False
        else:
            A[i] = A[i] / 2
    return True

#C++のmain関数みたいな
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    ans = 0 #counterと同じ

　#check_num == Trueの間実行する
    while True:
        if check_num() == False:
            break
        ans += 1

    print(str(ans))
Problem p03773 (python)

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

print((a + b) % 24)

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

printf((a + b) % 24)
Problem p02639 (python)

Fixed submission:
l=list(map(int,input().split()))
print(l.index(0)+1)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
dp=[1]*(ma+1)
ans=0

for i in range(len(A)-1):
  p=A[i]
  if dp[i]==1:
    for q in range(ma//p+1):
      dp[p*q]=0
    if A[i]!=A[i+1]:
      ans+=1
if dp[ma]==1:
  ans+=1
print(ans)
Problem p02642 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()                  #エラトステネスの篩にかけるためソート
Amax = A[-1]
dp = [1]*(Amax+1)         #Aの最大値までのエラトステネスの篩を作る。
ans = 0
for i in range(len(A)-1):
  p = A[i]
  if dp[p] == 1:          #A[i]がA[j]の倍数でないかをエラトステネスの篩でチェック
    for q in range(Amax//p+1):
      dp[p*q] = 0         #A[i]の倍数をすべて0にする
    if A[i] != A[i+1]: 
      ans += 1            #A[i]が重複していなければカウント
if dp[Amax] == 1:         #重複チェック時にレンジオーバーするためAmaxだけ別で判定 
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
dp=[1]*(ma+1)
ans=0

for i in range(len(A)-1):
  p=A[i]
  if dp[i]==1:
    for q in range(ma//p+1):
      dp[p*q]=0
    if A[i]!=A[i+1]:
      ans+=1
if dp[ma]==1:
  ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
dp=[1]*(ma+1)
ans=0

for i in range(len(A)-1):
  p=A[i]
  if dp[i]==1:
    for q in range(ma//p+1):
      dp[p*q]=0
    if dp[i]!=dp[i+1]:
      ans+=1
if dp[ma]==1:
  ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
dp=[1]*(ma+1)
ans=0

for i in range(N-1):
  p=dp[i]
  if dp[i]==1:
    for q in range(ma//p+1):
      dp[p*q]=0
    if dp[i]!=dp[i+1]:
      ans+=1
if dp[ma]==1:
  ans+=1
print(ans)
Problem p02706 (python)

Fixed submission:
n,m=map(int,input().split())
l=list(map(int,input().split()))
s=sum(l)
if s>n:
  print(-1)
else:
  print(n-s)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(map(int,input().split()))
s=sum(l)
if s>l:
  print(-1)
else:
  print(l-s)
Problem p02818 (python)

Fixed submission:
a,b,k=map(int,input().split())
if a>k:
    print(a-k,b)
elif a+b>k:
    print(0,b-k+a)
else:    
    print(0,0)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
x=a-k
if x<0:
	a=0
    x=k-a
    b=b-k
    if b<0:
		b=0
print(a,b)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
x=a-k
if x<0:
a=0
x=k-a
b=b-k
if b<0:
b=0
print(a,b)
Problem p02848 (python)

Fixed submission:
n=int(input())
s=input()
c=""
w=0
for i in s:
  w=ord(i)+n
  if w>ord("Z"):
    w=w-ord("Z")-1+ord("A")
  c+=chr(w)
  #print(chr(w))
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
n=n%26
s=input()
out=""
for i in s:
  no=ord(i)+n
  if no>ord("Z"):
    no=no-ord("Z")+ord("A")-1
  out+=ord(no)
print(out)
Problem p02922 (python)

Fixed submission:
import math
a,b=map(int,input().split())
print(math.ceil((b-1)/(a-1)))

Buggy submission (verdict: Runtime Error):
t=int(input())
d=int(input())
c=d//t
f=c/t
if f!=c:
  c+=1
print(c)
Problem p02924 (python)

Fixed submission:
n=int(input())
n-=1
f=(n*(n+1))//2
print(f)

Buggy submission (verdict: Runtime Error):
t=int(input())-1
print(((t*(t+1))//2)
Problem p02947 (python)

Fixed submission:
d={}
s=0
for _ in range(int(input())):
  l=input()
  l=str(sorted(l))
  f=d.keys()
  if l not in f:
    d[l]=0
  else:
    d[l]+=1
    s+=d[l]
print(s)

Buggy submission (verdict: Runtime Error):
d={}
s=0
for _ in range(int(input())):
  l=input()
  l=sorted(l)
  f=d.keys()
  if l not in f:
    d[l]=0
  else:
    d[j]+=1
    s+=d[j]
print(s)
Problem p02817 (python)

Fixed submission:
s,t = map(str,input().split())

print(t+s)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(b+a)
Problem p02971 (python)

Fixed submission:

n = int(input())
l = [0]*n
s = set()
f_max,s_max = 0,0
c = 0
for i in range(n):
    a = int(input())
    l[i] = a
    if f_max < a:
        s_max = f_max
        f_max = a
        c = 0
    elif s_max < a < f_max:
        s_max = a
    elif f_max == a:
        c+=1

#s.sort()

if len(s)==1:
    for i in range(n):
        print(l[0])

    exit()

if c==0:
    for i in range(n):
        if l[i]==f_max:
            print(s_max)
        else:
            print(f_max)
else:
    for i in range(n):
        print(f_max)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [0]*n
s = set()
f_max,s_max = 0,0
for i in range(n):
    a = int(input())
    l[i] = a
    
    if a not in s:
        s.add(a)

    if f_max < a:
        s_max = f_max
        f_max = a
    elif s_max < a < f_max:
        s_max = a

#s.sort()

if len(s)==1:
    for i in range(n):
        print(s[0])

    exit()

for i in range(n):
    #if l[i]==f_max:
    #    print(s_max)
    #else:
    #    print(f_max)
    #if l[i]==s[-1]:
    #    print(s[-2])
    #else:
    #    print(s[-1])
    s.remove(l[i])
    print(max(s))
    s.add(l[i])
Problem p02983 (python)

Fixed submission:
L,R = map(int,input().split())

#f = 0
l = []

if R-L>=2019:
    #f = 1
    print(0)
    exit()

for i in range(L,R):
    for j in range(i+1,R+1):
        l.append((i*j)%2019)
else:
    l.sort()

print(l[0])

Buggy submission (verdict: Runtime Error):
L,R = map(int,input().split())

#f = 0
l = []

if R-L>=2019:
    #f = 1
    print(0)
    exit()

for i in range(L,R):
    for j in range(i+1,R+1):
        l.append((i*j)%2019)
else:
    l.sort()

if 3 in l and 673 in l:
    print(0)
elif 3 in l:
    print(min(l),637))
elif 637 in l:
    print(min(l),3))
else:
    print(min(l))
Problem p02999 (python)

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

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

Fixed submission:
n = int(input())
s = input()
k = int(input())-1

res = ""
for i in s:
    if i!=s[k]:
        res += "*" 
    else:
        res += s[k]
else:
    print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())

res = ""
for i in s:
    if i!=s[k]:
        res += "*" 
    else:
        res += s[k]
else:
    print(res)
Problem p03076 (python)

Fixed submission:
l,s = [],[]
for i in range(5):
    num = int(input())
    l.append(num)
    if num%10!=0:
        s.append(num%10)

res = 0

for i in l:
    if i%10!=0:
        res += (i+10)//10*10
    else:
        res += i
else:
    if len(s) != 0:
        tmp = min(s)
    else:
        tmp = 10
    print(res-(10-tmp))

Buggy submission (verdict: Runtime Error):
l,s = [],[]
for i in range(5):
    num = int(input())
    l.append(num)
    s.append(num%10)

res = 0

s = list(set(s))
if 0 in s:
    s.remove(0)

for i in l:
    if i%10!=0:
        res += (i+10)//10*10
    else:
        res += i
else:
    tmp = min(s)
    print(res-(10-tmp)) if len(s)!=0 else print(res)

Buggy submission (verdict: Runtime Error):
l,s = [],[]
for i in range(5):
    num = int(input())
    l.append(num)
    s.append(num%10)
res = 0
s = list(set(s))
if 0 in s:
    s.remove(0)
for i in l:
    if i%10!=0:
        res += (i+10)//10*10
    else:
        res += i
else:
    print(res-(10-min(s)))

Buggy submission (verdict: Runtime Error):
l,s = [],[]
for i in range(5):
    num = int(input())
    l.append(num)
    s.append(num%10)
res = 0
s = list(set(s))
if 0 in s:
    s.remove(0)
for i in l:
    res += ((i+9)//10*10)
else:
    print(res-(10-min(s)))
Problem p03280 (python)

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

print((a-1)*(b-1))

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

print((a-1)*(b-1))
Problem p03289 (python)

Fixed submission:
s = input()
count = 0

for i in s:
    if ord("A") <= ord(i) <= ord("Z"):
        count += 1
else:
    if s.count("C") == 0:
        print("WA")
        exit()
    if s[0] == "A" and 2 <= s.index("C") <= len(s)-2 and count == 2:
        print("AC")
    else:
        print("WA")

Buggy submission (verdict: Runtime Error):
s = input()
count = 0

for i in s:
    if ord("A") <= ord(i) <= ord("Z"):
        count += 1
else:
    if s[0] == "A" and 2 <= s.index("C") <= len(s)-3 and count == 2:
        print("AC")
    else:
        print("WA")
Problem p03331 (python)

Fixed submission:
n = int(input())
m = str(n)
res = 0
for i in range(len(m)):
  res = res + int(m[i])
if res == 1:
    res *= 10
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
res = 0
for i in range(len(n)):
  res = res + n[i]
  
print(res)
Problem p03351 (python)

Fixed submission:
a = list(map(int,input().split()))
d = abs(a[0] - a[2])
d1 = abs(a[0] - a[1])
d2 = abs(a[1] - a[2])

if d <= a[3]:
  print("Yes")
elif d1 <= a[3] and d2 <= a[3]:
  print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
d = abs(a[0] - a[2])
d1 = abs(a[0] - a[1])
d2 = abs(a[1] - a[2])
if d <= a[3]:
  print("Yes")
elif d1 <= a[3] or d2 <= a[3]:
  print("Yes")
elif a[0] = a[1] and a[0] = a[2]:
  print("Yes")
else: print("No")
Problem p03360 (python)

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

BIG = max(a,b,c)
if BIG == a:
  print(BIG*(2**k)+b+c)
elif BIG == b:
  print(BIG*(2**k)+a+c)
else:
  print(BIG*(2**k)+a+b)

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

BIG = max(a,b,c)
if BIG == a:
  print(BIG*(2**k)+b+c)
elif BIG == b:
  print(BIG*(2**k)+a+c)
else:
  print(BIG*(2**k)+a+b)
Problem p03370 (python)

Fixed submission:
a,b = list(map(int,input().split()))
all_ = []

for i in range(a):
    usr = int(input())
    all_.append(usr)
else:
    num_a = a
    res_a = b - sum(all_)
    minimum = min(all_)
    num_b = res_a / minimum
    print(int(num_a + num_b))

Buggy submission (verdict: Runtime Error):
a,b = list(map(int,input().split()))
all_ = []
while a:
  all_.append(int(input()))
else:
  num_a = a
  res_a = b - sum(all_)
  minimum = min(all_)
  num_b = res_a / minimum
  print(num_a + num_b)
Problem p03399 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())

if a> b:
  num1 = b
else:
  num1 = a
if c > d:
  num2 = d
else:
  num2 = c
print(num1+num2)

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

if a> b:
  num1 = b
else:
  num1 = a
if c > d:
  num2 = d
else:
  num2 = c
print(nu1+num2)
Problem p03400 (python)

Fixed submission:
n = int(input())
d,x = list(map(int,input().split()))
res = 0
for i in range(n):
  a = int(input())
  res = res + int((d+a-1)/a)  

print(res+x)

Buggy submission (verdict: Runtime Error):
n = int(input())
d,x = list(map(int,input().split()))
res = 0
for i in range(n):
  res = res + int((d+i-1)/i)  

print(res+x)
Problem p03415 (python)

Fixed submission:
c1 = str(input())
c2 = str(input())
c3 = str(input())
res = ""

res += c1[0] + c2[1] + c3[2]

print(res)

Buggy submission (verdict: Runtime Error):
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))

print(c1[0],c2[1],c3[2])
Problem p03424 (python)

Fixed submission:
if __name__ == "__main__":
    n = int(input())
    s = list(set(list(map(str,input().split()))))
    print("Four") if len(s) == 4 else print("Three")

Buggy submission (verdict: Runtime Error):
l = ['P','W','G','Y']
l_ = [0,0,0,0]

n = int(input)
s = list(map(int,input()))

for i in range(len(s)):
  if s[i] == 'P':
    l_[0] += 1
  elif s[i] == 'W':
    l_[1] += 1
  elif s[i] == 'G':
    l_[2] += 1
  else:
    l_[3] += 1
else:
  for i in range(4):
    if l_[i] == 0:
      print("Three")
      break
    else:
      print("Four")
      break
Problem p03469 (python)

Fixed submission:
s = input()
s = s.replace("2017","2018")
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
s[3] = "8"
print(s)
Problem p03494 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
num = 0
flg = 1

while True:
    for i in range(len(l)):
        #print(i,num)
        if l[i] % 2 == 0:
            l[i] = l[i]/2
        else:
            print(num)
            flg = 0
            break
    if flg == 0:
        break
    else:
        num += 1
        continue

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

while True:
    if a%2 == 0 and b%2 == 0 and c%2 == 0:
        a = a/2
        b = b/2
        c = c/2
        num += 1
    else:
        print(num)
        break
Problem p03543 (python)

Fixed submission:
a = str(input())
b = list(a)

if (b[0] == b[1] and b[1] == b[2]) or (b[1] == b[2] and b[2] == b[3]):
  print("Yes")
else:
  print("No")

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

if (a[0] == a[1] and a[1] == a[2]) or (a[1] == a[2] and a[2] == a[3]):
  print("Yes")
else:
  print("No")
Problem p03547 (python)

Fixed submission:
x,y = map(str,input().split())

if ord(x) > ord(y):
  print(">")
elif ord(x) < ord(y):
  print("<")
else:
  print("=")

Buggy submission (verdict: Runtime Error):
x,y = str(input()),str(input())

def rep(a):
  if a == 'A':
    a = 10
  elif a == "B":
    a = 11
  elif a == "C":
    a = 12  
  elif a == "D":
    a = 13
  elif a == "E":
    a = 14
  elif a == "F":
    a = 15
  return None
    
rep(x)
rep(y)

if x < y:
  print("<")
elif x > y:
  print(">")
else:
  print("=")
Problem p03636 (python)

Fixed submission:
s = input()

res = s[0] + str(len(s)-2) + s[len(s)-1]

print(res)

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

res = str[0:1] + str(len(str)-2) +str[0:1:-1]
print(res)
Problem p03659 (python)

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

le,ri = 0,sum(l)
ans = []
for i in range(len(l)-1):
    le += l[i]
    ri -= l[i]
    ans.append(abs(le-ri))
else:
    print(min(ans))

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

le,ri = 0,sum(l)
ans = 10**10
for i in range(len(l)-1):
    le += l[i]
    ri -= l[i]
    ans = min(ans,abs(le-ri))
else:
    print(min(ans))

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

le,ri = 0,sum(l)
ans = 10**10
for i in range(len(l)-1):
    le += l[i]
    ri -= l[i]
    min(ans,abs(le-ri))
else:
    print(min(ans))
Problem p03679 (python)

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


def eat(x,a,b):
  if a - b >= 0:
    print("delicious")
  elif x + a - b < 0:
    print("dangerous")
  else:
    print("safe")
    
eat(x,a,b)

Buggy submission (verdict: Runtime Error):
a = map(int,input().split())
b = a[1] - a[2]

if b > a[0]:
  print("dangerous")
elif b > 0:
  print("delicious")
else: 
  print("safe")

Buggy submission (verdict: Runtime Error):
a = map(int,input().split())
b = a[1] - a[2]

if b > a[0]:
  print("dangerous")
elif b > 0:
  print("delicious")
else: 
  print("safe")

Buggy submission (verdict: Runtime Error):
a = map(int,input().sprit())
b = a[1] - a[2]

if b > a[0]:
  print("dangerous")
elif b > 0:
  print("delicious")
else: 
  print("safe")

Buggy submission (verdict: Runtime Error):
a = map(int,input(),sprit())
b = a[1] - a[2]

if b > a[0]:
  print("dangerous")
elif b > 0:
  print("delicious")
else: 
  print("safe")
Problem p03680 (python)

Fixed submission:
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))

zero = l[0]
count = 1

for i in range(n):
    #print("c:",count)
    if zero != 2:
        count += 1
        zero = l[zero-1]
    else:
        print(count)
        exit()
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))

zero = l[0]
count = 1
th = [zero]

def r(index,throw):
    global l
    now = l[index-1]
    # print(now,throw)
    if (now in throw) or (2 not in l):
        print(-1)
        return

    if now != 2:
        throw.append(now)
        r(now,throw)
    else:
        print(len(throw)+2)
        return

r(zero,th)
Problem p03697 (python)

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

if a + b >= 10:
  print("error")
else:
  print(a+b)

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

if a + b >= 10:
  print("error")
else:
  print(a+b)

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

if a + b >= 10:
  print("error")
else:
  print(a+b)

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

if a + b >= 10:
  print("error")
else:
  print(a+b)
Problem p03737 (python)

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

print(a[0].upper() + b[0].upper() + c[0].upper())

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = list(map(str,input().split()))
res = ""

res.append(s1[0].upper())
res.append(s2[0].upper())
res.append(s3[0].upper())

print(res)

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = list(map(int,input().split()))
res = ""

res.append(s1[0].upper())
res.append(s2[0].upper())
res.append(s3[0].upper())

print(res)
Problem p03773 (python)

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

b = a[0] + a[1]
if b >= 24:
  b -= 24
print(b)

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

b = a[0] + a[1]
if b > 24:
  b -= 24
print(b)