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

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

ans = X
for j in range(N):
    a = int(input())
    for i in range(D):
        if i*a + 1 <= D:
            ans += 1

print(ans)

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

ans = X
for j in range(N):
    a = int(input())
    for i in range(D):
        if i*a + i+1 <= D:
            ans += 1

print(ans)

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

ans = X
for i in range(N):
    a = int(input())
    for i in range(D):
        if i*a + i+1 <= D:
            ans += 1

print(ans)
Problem p03408 (python)

Fixed submission:
N=int(input())
n=[str(input()) for i in range(N)]
M=int(input())
m=[str(input()) for i in range(M)]
print(max(0, max(n.count(n[i])-m.count(n[i]) for i in range(N))))

Buggy submission (verdict: Runtime Error):
N = int(input())
n=[]
for i in range(N):
    n.append(input())
M = int(input())
m=[]
for i in range(M):
    m.append(input())
max=0
for i in n:
    max=max((n.count(i)-m.count(i)), max)
print(max)

Buggy submission (verdict: Runtime Error):
N = int(input())
n=[]
for i in range(N):
    n.append(input())
M = int(input())
m=[]
for i in range(M):
    m.append(input())
max=0
for i in n:
    max=max((n.count(i)-m.count(i)), max)
print(max)

Buggy submission (verdict: Runtime Error):
N=int(input())
n=[str(input()) for i in range(N)]
M=int(input())
m=[str(input()) for i in range(M)]
for i in range(N):
  print(max(0, max(n.count(n[i])-m.count(n[i]))))

Buggy submission (verdict: Runtime Error):
N=int(input())
n=[str(input()) for i in range(N)]
M=int(input())
m=[str(input()) for i in range(M)]
for i in range(N):
  print(max(0, max(n.count(n[i])-m.count(n[i]))))

Buggy submission (verdict: Runtime Error):
N=int(input())
n=[str(input()) for i in range(N)]
M=int(input())
m=[str(input()) for i in range(M)]
for i in range(N):
  print(max(0, max(n.count(n[i-1])-m.count(n[i-1]))))

Buggy submission (verdict: Runtime Error):
N=int(input())
n=[str(input()) for i in range(N)]
M=int(input())
m=[str(input()) for i in range(M)]
for i in range(N):
  result=n.count(n[i-1])-m.count(n[i-1]) 
If result>=0:
  print(result)
else:
  print(0)
Problem p03425 (python)

Fixed submission:
from itertools import combinations
import collections

N = int(input()) 

A = []
for i in range(N):
    A.append(input()[0])

C = collections.Counter(A)
print(sum(C[a]*C[b]*C[c] for a, b, c in combinations("MARCH", 3)))

Buggy submission (verdict: Runtime Error):
from itertools import combinations
import collections

N = int(input()) 

A = []
for i in range(N):
    A.append(input()[0])

AA = set(A)
C = collections.Counter(A)
print(sum(C[a]*C[b]*C[c] for a, b, c combinations(AA, 3)))
Problem p03433 (python)

Fixed submission:
N=int(input())
A=int(input())
count=0
for i in range(0, A+1):
    if (N-i)%500 == 0:
        count=1
        break
print("Yes" if count==1 else "No")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=int(input())
print("Yes" if (N-a)%500==0 else "No")

Buggy submission (verdict: Runtime Error):
N=int(input())
A=int(input())
print("Yes" if (N-a)%500 else "No")
Problem p03470 (python)

Fixed submission:
N=int(input())
list=[int(input()) for i in range(N)]
print(len(set(list)))

Buggy submission (verdict: Runtime Error):
S = int(input())
list=[]
for i in range(N):
    list.append(int(input()))
print(len(set(list)))

Buggy submission (verdict: Runtime Error):
S = int(input())
list=[]
for i in range(N):
    list.append(str(input()))
print(len(set(list)))

Buggy submission (verdict: Runtime Error):
S = int(input())
list=[]
for i in range(N):
    list.append(input())
print(len(set(list)))

Buggy submission (verdict: Runtime Error):
N=int(input())
list=[int(input()) for i in range(N)]
print(len(set(ist))

Buggy submission (verdict: Runtime Error):
N=int(input())
list=[int(input()) for i in range(N)]
print(len(set(ist)))
Problem p03486 (python)

Fixed submission:
S = str(input())
T = str(input())
S=sorted(S)
T=sorted(T, reverse=True)
if S < T:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
s.sort()
t.sort()
if s < t:
    print("Yes")
else:
    print("No")
Problem p03487 (python)

Fixed submission:
import collections

N = int(input())
A = list(map(int, input().split()))

c = collections.Counter(A)

ans = 0
for i in set(A):
    if i > c[i]:
        ans += c[i]
    if i < c[i]:
        ans += (c[i] -i)
print(ans)

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

N = int(input())
a = list(map(int, input().split()))

c = Counter(a)

ans = 0
for k, v in c.values():
    if k > v:
        ans += v
    else:
        ans += (v-k)

print(ans)
Problem p03493 (python)

Fixed submission:
a = int(input())
print(a%9)

Buggy submission (verdict: Runtime Error):
a = str(input())
if a=="000":
    print(0)
eif a=="001" or "010" or "100":
    print(1)
elif a=="111":
    print(3)
else:
    print(2)

Buggy submission (verdict: Runtime Error):
a = str(input())
if a==000:
    print(0)
eif a==001 or 010 or 100:
    print(1)
elif a==111:
    print(3)
else:
    print(2)

Buggy submission (verdict: Runtime Error):
a = int(input())
if a==000:
    print(0)
eif a==001 or 010 or 100:
    print(1)
elif a==111:
    print(3)
else:
    print(2)

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

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

Buggy submission (verdict: Runtime Error):
N = int(input())
list = list(int(input()))
count=0
while all(i%2 == 0 for i in list):
    count+=1
    list=[j/2 for j in list]
print(count)
Problem p03495 (python)

Fixed submission:
import collections

N, K = map(int, input().split())
A = list(map(int, input().split()))

number = len(set(A))

c = collections.Counter(A)
values,counts=zip(*c.most_common())
count = 0
for i in range(number):
    if number <= K:
        print(count)
        break
    count += counts[-(i+1)]
    number -= 1

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

N, K = map(int, input().split())
A = list(map(int, input().split()))

c = Counter(A)

for i in range(len(A)-K):
    ans += c.most_common()[i][1]

print(ans)
Problem p03503 (python)

Fixed submission:
N = int(input())
F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for j in range(N)]  
m = -9999999999  
for i in range(1, 2**10):
    s = 0
    for j in range(N):
        count = 0
        for k in range(10):
            if ((i >> k)&1) == 1 and F[j][k] == 1:
                count += 1
        s += P[j][count]
    m = max(m, s)  
print(m)

Buggy submission (verdict: Runtime Error):
N = int(input())
F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for j in range(N)]  
max = -9999999999  
for i in range(1, 2**10):
    sum = 0
    for j in range(N):
        count = 0
        for k in range(10):
            if ((i >> k)&1) == 1 and F[j][k] == 1:
                count += 1
        sum += P[j][count]
    max = max(max, sum)  
print(max)

Buggy submission (verdict: Runtime Error):
N = int(input())
F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for j in range(N)]  
max = -9999999999  
for i in range(1, 2**10):
    for j in range(N):
        count = 0
        for k in range(10):
            if ((i >> k)&1) == 1 and F[j][k] == 1:
                count += 1
        sum += P[j][count]
    max = max(max, sum)  
print(max)
Problem p03547 (python)

Fixed submission:
X, Y = map(str, input().split())
print("<" if X < Y else ">" if X > Y else "=")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A < B:
    print("<")
elif A==B:
    print("=")
else:
    print(">")

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
print("<" if X < Y else ">" if X > Y else "=")
Problem p03549 (python)

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

ans = 0

for i in range(1, 100000):
    p = ((1/2)**M)*(1-(1/2)**M)**(i-1)
    ans += (100*(N-M) + 1900*M)*i*p

print(round(ans))

Buggy submission (verdict: Runtime Error):
N, M = int(input().split())

ans = 0

for i in range(1, 100000):
    p = ((1/2)**M)*(1-(1/2)**M)**(i-1)
    ans += (100*(N-M) + 1900*M)*i*p

print(round(ans))

Buggy submission (verdict: Runtime Error):
N, M = int(input().split())

ans = 0

for i in range(1, 1000000):
    p = ((1/2)**M)*(1-(1/2)**M)**(i-1)
    ans += (100*(N-M) + 1900*M)*i*p

print(round(ans))

Buggy submission (verdict: Runtime Error):
N, M = int(input().split())

ans = 0

for i in range(1, 1000000):
    p = ((1/2)**M)*(1-(1/2)**M)**(i-1)
    ans += (100*(N-M) + 1900*M)*i*p

print(int(ans))
Problem p03555 (python)

Fixed submission:
A=str(input())
B=str(input())
if A[0]==B[2] and A[1]==B[1] and A[2]==B[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A=input().split()
B=input().split()
if A[0]==B[2] and A[1]==B[1] and A[2]==B[2]:
    print("YES")
else:
    print("NO")
Problem p03557 (python)

Fixed submission:
import bisect
N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    x = bisect.bisect_left(A, B[i])
    y = N-bisect.bisect_right(C, B[i])
    ans += x*y
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort()
B.sort()
C.sort()

ans = 0
for b in B:
    a = bisect.bisect_left(A, x)
    b = bisect.bisect_right(C, x)
    ans += (a + 1)*b 

print(ans)
Problem p03564 (python)

Fixed submission:
a = int(input())
b = int(input())
n=1
for i in range(a):
    n=min(n*2, n+b)
print(n)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
n=1
for i in range(a):
    n=min(n*2, n+k)
print(n)
Problem p03575 (python)

Fixed submission:
n,m=map(int,input().split())
l=[[] for _ in range(n)]
for _ in range(m):
    a,b=map(int,input().split())
    l[a-1].append(b-1)
    l[b-1].append(a-1)
a=0
while 1:
    x=0
    for i in range(n):
        if len(l[i])==1:
            l[l[i][0]].remove(i)
            l[i]=[]
            x+=1
    if x==0:break
    a+=x
print(a)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
d=[[] for i in range(N)]
for i in range(M):
    b, c = map(int, input().split())
    l[b-1].append(c-1)
    l[c-1].append(b-1)
a=0
while True:
    count = 0
    for i in range(N):
        if len(d[i]) == 1:
            d[d[i][0]].remove(i)
            d[i]=[]
            count += 1
        if count == 0:
            break
        a+=count
print(a)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
d=[[] for i in range(N)]
for i in range(M):
    b, c = map(int, input().split())
    for j in range(N):
        if b == j:
            d[j-1].append(c-1)
        if c == j:
            d[j-1].append(b-1)
a=0
while True:
    count = 0
    for i in range(N):
        if len(d[i]) == 1:
            d[d[i]-1].remove(i)
            d[i]=[]
            count += 1
        if count == 0:
            break
        a+=count
print(a)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
d=[[] for i in range(N)]
for i in range(M):
    b, c = map(int, input().split())
    for j in range(N):
        if b == j:
            d[j-1].append(c-1)
        if c == j:
            d[j-1].append(b-1)
while True:
    count = 0
    for i in range(N):
        if len(d[i]) == 1:
            d[d[i]-1].remove(i)
            d[i]=[]
            count += 1
        if count == 0:
            break
        a+=count
print(a)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
d=[[] for i in range(N)]
for i in range(M):
    b, c = map(int, input().split())
    for j in range(1, N+1):
        if b == j:
            d[j-1].append(c-1)
        if c == j:
            d[j-1].append(b-1)
while True:
    count = 0
    for i in range(N):
        if len(d[i]) == 1:
            d[d[i]-1].remove(i)
            d[i]=[]
            count += 1
        if count == 0:
            break
        a+=count
print(a)
Problem p03576 (python)

Fixed submission:
N, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])

ans = float("INF")
for i in range(N):
    for j in range(i+K-1, N):
        W = XY[j][0] - XY[i][0]
        Y = [XY[x][1] for x in range(i, j+1)]
        Y.sort()
        for l, k in zip(Y, Y[K-1:]):
                H = k - l
                ans = min(ans, W*H)

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])

ans = float("INF")
for i in range(N):
    for j in range(i+K-1, N):
        W = XY[j][0] - XY[i][0]
        Y = [XY[x][1] for x in range(i, j+1)]
        Y.sort()
        for k in range(len(Y)):
            for l in range(i+K-1, N):
                H = Y[l] - Y[k]
                ans = min(ans, W*H)

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])

ans = float("INF")
for i in range(N):
    for j in range(i+K-1, N):
        W = XY[j][0] - XY[i][0]
        Y = [XY[x][1] for x in range(i, j+1)]
        Y.sort()
        for l, k in zip(Y, Y[K-1:]):
                H = Y[k] - Y[l]
                ans = min(ans, W*H)

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])

ans = float("INF")
for i in range(N):
    for j in range(i+K-1, N):
        W = XY[j][0] - XY[i][0]
        Y = [XY[x][1] for x in range(i, j+1)]
        Y.sort()
        for k in range(len(Y)):
            for l in range(k+K-1, N):
                H = Y[l] - Y[k]
                ans = min(ans, W*H)

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(n)]

XY.sort(key lambda x: x[0])

ans = float("INF")
for i in range(N-K):
    for j in range(i + K - 1, N):
        W = XY[j][0] - XY[i][0]
        Y = [XY[x][1] for x in range(i, j+1)]
        Y.sort()
        for k in range(len(Y)-K):
            for l in range(k + K - 1, N):
                H = Y[l] - Y[k]
                ans = min(ans, W*H)

print(ans)
Problem p03597 (python)

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

Buggy submission (verdict: Runtime Error):
N = input().split()
A = input().split()
print(N*N-A)
Problem p03606 (python)

Fixed submission:
n=int(input())
sum=0
for i in range(n):
  l, r =map(int, input().split())
  sum+=(r-l+1)
print(sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
sum=0
for i range(N):
  l, r =map(int, input().split())
  sum+=(r-l+1)
print(sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
sum=0
for i range(N):

Buggy submission (verdict: Runtime Error):
N=int(input())
sum=0
for i range(N):
  l, r =map(int, input().split())

Buggy submission (verdict: Runtime Error):
N=int(input())
sum=0
for i range(N):
  l, r =map(int, input().split())
  sum+=(r-l+1)
print(sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
sum=0
for i range(N):
  l, r =map(int,input().split())

Buggy submission (verdict: Runtime Error):
N=int(input())
sum=0
for i range(N):
  l, r =map(int,input().split())
  sum+=(r-l+1)
print(sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
sum=0
for i range(N):
  l, r =map(int, input().split())
  sum+=(r-l+1)
print(100000-sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
sum=0
for i range(N):
  l, r =map(int,input().split())
  sum+=r-l+1
print(100000-sum)
Problem p03607 (python)

Fixed submission:
N = int(input())
list=set()
for i in range(N):
    list ^= {int(input())}
print(len(list))

Buggy submission (verdict: Runtime Error):
N = int(input())
list={}
for i in range(N):
    list ^= {int(input())}
print(len(list))
Problem p03624 (python)

Fixed submission:
S = input()
for i in range(ord("a"), ord("z")+1):
    if chr(i) not in S:
        print(chr(i))
        break
else:
    print("None")

Buggy submission (verdict: Runtime Error):
S=list(input())
import string
X= list(string.ascii_lowercase)
for i in list:
    if i not in S:
        print(i)
        break
Problem p03627 (python)

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
a = collections.Counter(A)
ans = [0, 0]
for i in a.keys():
    if a[i] >= 2:
        ans.append(i)
    if a[i] >= 4:
        ans.append(i)
ans.sort()
print(ans[-1]*ans[-2])

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

N = int(input())
A = list(map(int, input().split()))

c = Counter(A)


ans = []
for i, j in c.items():
    if j >= 2:
        ans.append(i)

ans.sort()    

print(ans[-1]*ans[-2])

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

N = int(input())
A = list(map(int, input().split()))

    
c = Counter(A)


ans = []
for i, j in c.items():
    if j >= 2:
        ans.append[i]

ans.sort()    
print(ans[-1]*ans[-2])

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

N = int(input())
A = list(map(int, input().split()))

    
c = Counter(l)


ans = []
for i, j in c.items():
    if i >= 2:
        ans.append[j]

ans.sort()    
print(ans[-1]*ans[-2])

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A = sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = 0
y = 0
for i in a.keys():
    if a[i] >= 2:
        x = y*i
        y = i
    if a[i] >= 4:
        z = i**2
    ans = max(ans, x, z)
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A=sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = 0
y = 0
for i in a.keys():
    if a[i] >= 2:
        x = y*i
        y = i
    if a[i] >= 4:
        z = i**2
    ans = max(ans, x, z)
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
N = int(input())
A=sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = 0
y = 0
for i in a.keys():
    if a[i] >= 2:
        x = y*i
        y = i
    if a[i] >= 4:
        z = i**2
    ans = max(ans, x, z)
print(ans)
Problem p03635 (python)

Fixed submission:
A, B =map(int, input().split())
print(((A-1)*(B-1)))

Buggy submission (verdict: Runtime Error):
A, B =map(int, input().split())
print(max((A-1)*(B-1)))
Problem p03636 (python)

Fixed submission:
s=str(input())
print(s[0]+str(len(s)-2)+s[-1])

Buggy submission (verdict: Runtime Error):
s=str(input())
print(s[0]+int(len(s)-2)+s[-1])

Buggy submission (verdict: Runtime Error):
s=list(input())
print(s[0]+len(s-2)+s[-1])
Problem p03637 (python)

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

cntA = 0
cntB = 0
for i in range(N):
    if A[i]%4 == 0:
        cntA += 1
    elif A[i]%2 == 0:
        cntB += 1

print("Yes" if cntA + cntB//2  >= N//2 else "No")

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

cnt4 = 0
cnt2 = 0
for i in range(N):
    if A[i]%4 == 0:
        cnt4 += 1
    elif A[i]%2 == 0:
        cnt2 += 1

print("Yes" if cnt4*2 + cnt2 >= N else "No")
Problem p03644 (python)

Fixed submission:
N=int(input())
for i in range(7):
  x=2**i
  if x<=N:
      max=2**i
print(max)

Buggy submission (verdict: Runtime Error):
N=int(input())
for i in range(7):
  x=2**(i-0)
  if x<=N:
      max=max(x)
print(x)
Problem p03671 (python)

Fixed submission:
a, b, c = map(int, input().split())
print(a+b+c - max(a, b, c))

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(sum(a, b, c) - max(a, b, c))
Problem p03672 (python)

Fixed submission:
list = list(str(input()))
while True:
    list.pop(-1)
    if len(list)%2==0:
        M=len(list)//2
        if list[0:M-1] == list[M:-1]:
            print(len(list))
            break

Buggy submission (verdict: Runtime Error):
S = str(input())
count=0
for i in range(len(S)):
    S=S[:-1]
    if S//2==0:
        x=S//2
        count+=1
        if S[:x] == S[x+1:]:
            print(count)
            break
Problem p03673 (python)

Fixed submission:
n = int(input())
S = list(map(int, input().split()))
S=S[::-1]
x=S[::2]
y=S[1::2]
b=x+y[::-1]
print(*b, sep=" ")

Buggy submission (verdict: Runtime Error):
n = int(input())
S = list(map(int, input().split()))
b=[]
for in range(n):
    b.append(S[i])
    b=b[::-1]
print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
S = list(map(int, input().split()))
b=[]
for in range(n):
    b.append(S[i])
    S=S[::-1]
Problem p03679 (python)

Fixed submission:
X, A, B = map(int, input().split())
if B <= A:
    print("delicious")
else:
    if (B-A) <= X:
        print("safe")
    if (B-A) > X:
        print("dangerous")

Buggy submission (verdict: Runtime Error):
X, A, B = map(int, input().split())
if A <= B:
    print("delicious")
if (B-A) <= X:
    pirint("safe")
if X < (B-A):
    print("dangerous")

Buggy submission (verdict: Runtime Error):
X, A, B = map(int, input().split())
if A <= B:
    print("delicious")
if (B-A) <= X:
    pirnt("safe")
if X < (B-A):
    print("dangerous")

Buggy submission (verdict: Runtime Error):
X, A, B = map(int, input().split())
if A <= B:
    print("delicious")
elif (B-A) <= X:
    pirnt("safe")
elif X < (B-A):
    print("dangerous")

Buggy submission (verdict: Runtime Error):
X, A, B = map(int, input().split())
if A <= B:
    print("delicious")
elif (B-A) <= X:
    pirnt("safe")
else:
    print("dangerous")
Problem p03680 (python)

Fixed submission:
N = int(input())
list=[]
for i in range(N):
    list.append(int(input()))
count=0
X=list[0]
while True:
    count+=1
    if X == 2:
        print(count)
        break
    elif count == N:
        print(-1)
        break
    X=list[X-1]

Buggy submission (verdict: Runtime Error):
N = str(input())
list=[]
for i in range(N):
    list.append(int(input()))
count=0
X=list[0]
while True:
    X=list[X-1]
    count+=1
    if X == 2:
        print(count+1)
    if count == 100000:
        print(-1)
Problem p03693 (python)

Fixed submission:
x =int(input().replace(" ", ""))
print("YES" if x%4 == 0 else "NO")

Buggy submission (verdict: Runtime Error):
N = map(int, input().replace(" ", ""))
print("YES" if N%4==0 else "NO")

Buggy submission (verdict: Runtime Error):
x =map(int, input().replace(" ", ""))
print("YES" if x%4 == 0 else "NO")
Problem p03699 (python)

Fixed submission:
N = int(input())

A=[]
for i in range(N):
    A.append(int(input()))

A.sort()

gokei = sum(A)

if gokei%10 != 0:
    print(gokei)
else:
    for i in range(N):
        if (gokei - A[i])%10 != 0:
            print(gokei - A[i])
            break
    else:
        print(0)

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

A=[]
for i in range(N):
    A.append(i)

B = []
for i in range(2**N):
    gokei = 0
    for j in range(N):
        if ((i >> j) & 1):
            gokei += A[j]
    gokei.append(B)

B.sort(reverse=True)

for i in B:
    if i%10 != 0:
        print(i)
        exit()