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

Fixed submission:
s = input()
na = 0
nb = 0
nc = 0

for c in s:
  if c == 'a': na += 1
  if c == 'b': nb += 1
  if c == 'c': nc += 1

if na == nb == nc:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b, c = (i for i in input().split())
if ord(a) + ord(b) + ord(c) == ord('a') + ord('b') + ord('c'):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
na = 0
nb = 0
nc = 0
for c in s:
  if c == 'a': na += 1
  if c == 'b': nb += 1
  if c == 'c': nc += 1

if a == b == c:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
a = 0
b = 0
c = 0
for c in s:
  if c == 'a': a += 1
  if c == 'b': b += 1
  if c == 'c': c += 1

if a == b == c:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
a = b = c = 0
for c in s:
  if c == 'a': a += 1
  if c == 'b': b += 1
  if c == 'c': c += 1

if a == b == c:
  print('Yes')
else:
  print('No')
Problem p03399 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a,b) + min(c,d))

Buggy submission (verdict: Runtime Error):
a, b, c, d = (int(i) for i in input().split())
print(min(a,b) + min(c,d))
Problem p03469 (python)

Fixed submission:
s = input()
if s[3] == '7':
  ans = s[:3] + '8' + s[4:]
else:
  ans = s
print(ans)

Buggy submission (verdict: Runtime Error):
s = list(input())
if s[3] == '7':
  ans = s[:3] + '8' + s[4:]
else:
  ans = s
print(ans)

Buggy submission (verdict: Runtime Error):
s = list(input())
if s[3] == '7':
  s = s[:3] + '8' + s[4:]
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
if s[3] == '7':
  s[3] = '8'
print(s)
Problem p03486 (python)

Fixed submission:
s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)
s = ''.join(s)
t = ''.join(t)
if s < t:
    print('Yes')
else:
    print('No')

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

s.sort()
t.sort(reverse=True)
s = ''.join(s)
t = ''.join(t)
if s < t:
    print('Yes')
else:
    print('No')
Problem p03545 (python)

Fixed submission:
S = input()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

idx = [0, 1, 2]
output = []
for i in range(1 << len(idx)):
    ops = ['+', '+', '+']
    if A+B+C+D == 7: 
        print(A,ops[0],B,ops[1],C,ops[2],D,'=7',sep='')
        exit()
    
    ans = A
    for j in range(len(idx)):
        if ((i >> j) & 1) == 1:
            ops[j] = '-'
    
    if ops[0] == '+' : ans += B
    else : ans -= B
    
    if ops[1] == '+' : ans += C
    else : ans -= C
    
    if ops[2] == '+' : ans += D
    else : ans -= D
    
    if ans == 7:
        print(A,ops[0],B,ops[1],C,ops[2],D,'=7',sep='')
        exit()

Buggy submission (verdict: Runtime Error):
S = input()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

idx = [0, 1, 2]
output = []
for i in range(1 << len(idx)):
    ops = ['+', '+', '+']
    if A+B+C+D == 7: 
        print(f'{A}{ops[0]}{B}{ops[1]}{C}{ops[2]}{D}=7')
        exit()
    
    ans = A
    for j in range(len(idx)):
        if ((i >> j) & 1) == 1:
            ops[j] = '-'
    
    if ops[0] == '+' : ans += B
    else : ans -= B
    
    if ops[1] == '+' : ans += C
    else : ans -= C
    
    if ops[2] == '+' : ans += D
    else : ans -= D
    
    if ans == 7:
        print(f'{A}{ops[0]}{B}{ops[1]}{C}{ops[2]}{D}=7')
        exit()
Problem p03555 (python)

Fixed submission:
s1 = input()
s2 = input()

if s1[0] == s2[2] and s1[1] == s2[1] and s1[2] == s2[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = (i for i in input().split())
d, e, f = (i for i in input().split())

if a == f and b == e and c == d:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = (int(i) for i in input().split())
d, e, f = (int(i) for i in input().split())

if a == f and b == e and c == d:
  print('YES')
else:
  print('NO')
Problem p03679 (python)

Fixed submission:
x, a, b = (int(i) for i in input().split())

n = b - a
if n <= 0:
  print('delicious')
elif n <= x:
  print('safe')
else:
  print('dangerous')

Buggy submission (verdict: Runtime Error):
x, a, b = (int(i) for i in input().split())

if b-a <= 0: 
  print('delicious')
elif b-a <= X:
  print('safe')
else:
  print('dengerous')
Problem p03844 (python)

Fixed submission:
a, op, b = (i for i in input().split())

if op == '+':
  print(int(a)+int(b))
else:
  print(int(a)-int(b))

Buggy submission (verdict: Runtime Error):
a, op, b = (i for i in input().split())

if op == '+':
  print(a+b)
else:
  print(a-b)
Problem p02534 (python)

Fixed submission:
K = int(input())
print('ACL'*K)

Buggy submission (verdict: Runtime Error):
K = input()
print('ACL'*K)
Problem p02582 (python)

Fixed submission:
s = input()

if s == "RSS" or s == "SRS" or s == "SSR" or s == "RSR":
    print(1)
elif s == "RRS" or s == "SRR":
    print(2)
elif s == "RRR":
    print(3)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
x,k,d = map(int,input().split())
cnt = x//d
mod = x%d
mini = 0

if k < cnt:
    print(x-(d*k))
    exit()

if mod > abs(mod-d):
    mini = abs(mod-d)
    cnt += 1
else:
    mini = mod

if k%2 == 1:
    if cnt%2 == 1:
        print(x-(d*cnt))
    else:
        print(min(abs(mini-d),mini+d))
else:
    if cnt%2 == 0:
        print(x-(d*cnt))
    else:
        print(min(abs(mini-d),mini+d))
Problem p02615 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse = True)
ans = [0]*(n-1)
ans[0] = a[0]

for i in range(2,n):
    p = i//2
    ans[i-1] = a[p]

print(sum(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse = True)
ans = [0]*(n-1)
ans[0] = a[0]

for i in range(2,n):
    p = a[(i)//2]
    ans[i-1] = a[p]

print(sum(ans))
Problem p02639 (python)

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

cnt = 1
for i in range(len(l)):
    if l[i] == 0:
        break
    else:
        cnt += 1
        

print(cnt)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
 
ans = 0
for i in range(x+1):
    f = (2*i) + 4*(x-i)
    if  f == y:
        print("Yes")
        exit()
 
print("No")
Problem p02657 (python)

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

print(a*b)

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int,input().split()))
ans = 1

for i in a:
    ans = ans*i
    if ans > 1000000000000000000:
        ans = -1
        exit
    elif ans == 0:
        exit

print(ans)
Problem p02658 (python)

Fixed submission:
import numpy as np
import sys
input = sys.stdin.readline
 
n = int(input())
a = list(map(int,input().split()))
ans = 1

for i in a:
    ans *= i
    if ans > 10**18:
        ans = -1
        break
 
if 0 in a:
    ans = 0

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int,input().split()))
ans = 1

for i in a:
    ans = ans*i
    if ans > 1000000000000000000:
        ans = -1
        exit
    elif ans == 0:
        exit

print(ans)
Problem p02687 (python)

Fixed submission:
s = str(input())

if s == "ABC":
    print("ARC")
else:
    print("ABC")

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

if s == "ABC":
    print("ARC")
else:
    print("ABC)
Problem p02717 (python)

Fixed submission:
x,y,z = map(int,input().split())
print(z,x,y)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
l = x = [int(i) for i in input().split()]
l_sum = sum(l)
cnt = 0
 
for i in range(N):
    if l[i] > (1//(4*M))*l_sum:
        cnt += 1
 
if cnt >= M:
    print("Yes")
else:
    print("No")
Problem p02909 (python)

Fixed submission:
s = str(input())

if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

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

if s == "Sunny":
    print("Cloudy")
elif s == "Cloudy":
    print("Rainy")
else:
    print("Sunny":)
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
temp = 0
ans = []

for i in range(N-1):
    if H[i] >= H[i+1]:
        temp += 1
    else:
        ans.append(temp)
        temp = 0
ans.append(temp)

print(max(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
ans = []
temp = 0

for i in range(0,N-1):
    if H[i] >= H[i+1]:
        temp += 1
    else:
        temp = 0
    ans.append(temp)
        
print(max(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
ans = []
temp = 0

for i in range(N-1):
    if H[i] >= H[i+1]:
        temp += 1
    else:
        temp = 0
    ans.append(temp)
        
print(max(ans))
Problem p02934 (python)

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

for i in range(N):
    A[i] = 1 / A[i]

print(1 / sum(A))

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

for i in range(N+1):
    A[i] = 1 / A[i]

print(1 / sum(A))
Problem p02953 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
pre = -999
frag = 0

for i in range(N):
    if A[i]-1 >= pre:
        pre = A[i] - 1
    elif A[i] >= pre:
        pre = A[i]
    else:
        frag += 1
        break
        
if frag == 1:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
pre = -999
frag = 0

for i in range(N+1):
    if A[i]-1 >= pre:
        pre = A[i] - 1
    elif A[i] >= pre:
        pre = A[i]
    else:
        frag += 1
        break
        
if frag == 1:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
frag = 0
tmp = 0
 
for i in range(0,N):
    if A[i] > A[i+1]:
        A[i] = A[i] - 1
        tmp = max(A)
        if A[i] > A[i+1] or tmp > A[i+1]:
            frag += 1
            break
 
if frag == 1:
    print("No")
else:
    print("Yes")

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

for i in range(0,N):
    if A[i] > A[i+1]:
        A[i] -= 1
        tmp = A[i]
        if A[i-1] > A[i] or tmp > A[i+1]:
            frag += 1
            break

if frag >= 1:
    print("No")
else:
    print("Yes")
Problem p02957 (python)

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

if N % 2 == 0:
    print((A+B)//2)
elif N % 2 != 0:
    print("IMPOSSIBLE")

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

for i in range(N-1):
    if A[i]+1 != A[i+1]:
        cnt += 1

if cnt <= 2:
    print("YES")
elif cnt > 3:
    print("NO")
Problem p02993 (python)

Fixed submission:
S = [str(x) for x in input()]
cnt = 0
 
for i in range(0,3):
    if S[i] == S[i+1]:
        cnt += 1
 
if cnt >= 1:
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
S = sorted(str,input())
Scnt = len(S)
Sset = set(S)

if Scnt == Sset:
    print("Good")
else:
    print("Bad")
Problem p03001 (python)

Fixed submission:
w,h,x,y = map(int,input().split())
tmp1 = abs(w-x)
tmp2 = abs(h-y)

ans = w*h/2

if x == w/2 and y == h/2:
    print(ans,1)
else:
    print(ans,0)

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(int,input().split())
tmp1 = abs(w-x)
tmp2 = abs(h-y)

f = 0
if w%h == 0 and x%y == 0:
    f = 1

if tmp1 > tmp2:
    tmp = min(tmp2,y)
    print(w*tmp,f)
else:
    tmp = min(tmp1,x)
    print(h*tmp,f)
Problem p03085 (python)

Fixed submission:
n = str(input())

if n == "A":
    print("T")
elif n == "T":
    print("A")
elif n == "C":
    print("G")
else:
    print("C")

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

if n == "A":
    print("T")
elif n == "T":
    print("A")
elif n == "C":
    print("G")
else:
    print("C")
Problem p03087 (python)

Fixed submission:
n,q = map(int,input().split())
s = input()
lr = [0] * (n+1)

for i in range(n):
    lr[i+1] = lr[i]+(1 if s[i:i+2] == "AC" else 0)

for i in range(q):
    st,fn = map(int,input().split())
    print(lr[fn-1] - lr[st-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = list(map(str,input()))
lr = [0] * (n+1)

for i in range(n):
    if s[i] == "A" and s[i+1] == "C":
        lr[i+1] = lr[i]+1
    else:
        lr[i+1] = lr[i]

for i in range(q):
    st,fn = map(int,input().split())
    print(lr[fn-1] - lr[st-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = list(map(str,input()))
lr = [0] * (n+1)

for i in range(n):
    if s[i] == "A" and s[i+1] == "C":
        lr[i+1] = lr[i]+1
    else:
        lr[i+1] = lr[i]

for i in range(q):
    st,fn = map(int,input().split())
    print(lr[fn-1] - lr[st-1])
Problem p03206 (python)

Fixed submission:
d = int(input())

if d == 22:
    print("Christmas Eve Eve Eve")
elif d == 23:
    print("Christmas Eve Eve")
elif d == 24:
    print("Christmas Eve")
else:
    print("Christmas")

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = []
for _ in range(n):
    a = int(input())
    l.append(a)

ans = 10**9
l.sort()
for i in range(n-k+1):
    tmp = max(l[i:k+i]) - min(l[i:k+i])
    if tmp < ans:
        ans = tmp

print(ans)
Problem p03337 (python)

Fixed submission:
a,b = map(int,input().split())
t = a+b
h = a-b
k = a*b
print(max(t,h,k))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(str,input()))

ans = 0
for i in range(n):
    a = l[0:i]
    b = l[i:n-1]
    tmp = []
    for j in a:
        if j in b:
            tmp.append(j)
    tmp = set(tmp)
    ans = (max(ans,len(tmp)))

print(ans)
Problem p03352 (python)

Fixed submission:
import math

x = int(input())
ans = [1]
s = int(math.sqrt(x))
if s >= 2:
    for i in range(2,s+1):
        temp = i
        while True:
            temp *= i
            if temp <= x:
                ans.append(temp)
            else:
                break

print(max(ans))

Buggy submission (verdict: Runtime Error):
import math

x = int(input())
ans = [1]
s = int(math.sqrt(x))
if s >= 2:
    for i in range(2,s+1):
        temp = i
        while True:
            temp *= i
            if temp <= n:
                ans.append(temp)
            else:
                break

print(max(ans))

Buggy submission (verdict: Runtime Error):
import math

x = int(input())
ans = [1]
s = math.sqrt(x)
if s >= 2:
    for i in range(2,s+1):
        temp = i
        while True:
            temp *= i
            if temp <= n:
                ans.append(temp)
            else:
                break

print(max(ans))
Problem p03423 (python)

Fixed submission:
n = int(input())
print(n//3)

Buggy submission (verdict: Runtime Error):
import numpy as np
from scipy.special import comb

n = int(input())
a = []
for _ in range(n):
    b = list(map(str,input()))
    a.append(b)

ans = [0]*5

for i in range(n):
    tmp = a[i][0]
    if tmp == "M":
        ans[0] += 1
    elif tmp == "A":
        ans[1] += 1
    elif tmp == "R":
        ans[2] += 1
    elif tmp == "C":
        ans[3] += 1
    elif tmp == "H":
        ans[4] += 1
    else:
        continue

cnt = []
for j in range(len(ans)):
    if ans[j] == 0:
        continue
    else:
        cnt.append(ans[j])
l = 0
for k in range(len(cnt)):
    if cnt[k] > 1:
        l += cnt[k] - 1

cnt.sort()
if len(cnt) <= 2:
    print(0)
elif len(cnt) == 3:
    print(np.prod(cnt))
elif len(cnt) == 4:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3]))
else:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3])+(6*cnt[4]))
Problem p03425 (python)

Fixed submission:
import itertools

n = int(input())
a = []
for _ in range(n):
    b = list(map(str,input()))
    a.append(b)

ans = [0]*5

for i in range(n):
    tmp = a[i][0]
    if tmp == "M":
        ans[0] += 1
    elif tmp == "A":
        ans[1] += 1
    elif tmp == "R":
        ans[2] += 1
    elif tmp == "C":
        ans[3] += 1
    elif tmp == "H":
        ans[4] += 1
    else:
        continue

cnt = 0
for l in itertools.combinations(ans,3):
    cnt += l[0]*l[1]*l[2]

print(cnt)

Buggy submission (verdict: Runtime Error):
import numpy as np
from scipy.special import comb

n = int(input())
a = []
for _ in range(n):
    b = list(map(str,input()))
    a.append(b)

ans = [0]*5

for i in range(n):
    tmp = a[i][0]
    if tmp == "M":
        ans[0] += 1
    elif tmp == "A":
        ans[1] += 1
    elif tmp == "R":
        ans[2] += 1
    elif tmp == "C":
        ans[3] += 1
    elif tmp == "H":
        ans[4] += 1
    else:
        continue

cnt = []
for j in range(len(ans)):
    if ans[j] == 0:
        continue
    else:
        cnt.append(ans[j])
l = 0
for k in range(len(cnt)):
    if cnt[k] > 1:
        l += cnt[k] - 1

cnt.sort()
print(cnt)
if len(cnt) <= 2:
    print(0)
elif len(cnt) == 3:
    print(np.prod(cnt))
elif len(cnt) == 4:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3]))
else:
    print((cnt[0]*cnt[1]*cnt[2])+(3*cnt[3])+(6*cnt[4]))
Problem p03449 (python)

Fixed submission:
n = int(input())
l = []
for _ in range(2):
    a = list(map(int,input().split()))
    l.append(a)

if n == 1:
    print(l[0][0]+l[1][0])
    exit()

m1 = []
m2 = []
m1.append(0)
m1.append(l[0][0])
m2.append(0)
m2.append(l[1][0])

for i in range(1,n):
    m1.append(m1[i]+l[0][i])
    m2.append(m2[i]+l[1][i])

ans = [0]*n
for j in range(1,n+1):
    ans[j-1] = m1[j]+(m2[n]-m2[j-1])


print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = []
for _ in range(3):
    a = list(map(int,input().split()))
    l.append(a)

if n == 1:
    print(l[0][0]+l[1][0])
    exit()
    
m1 = []
m2 = []
m1.append(l[0][0])
m2.append(l[1][0])
for i in range(1,n):
    m1.append(m1[i-1]+l[0][i])
    m2.append(m2[i-1]+l[1][i])

ans = [0]*n
for j in range(n):
    ans[j] = m1[j]+(m2[n-1]-m2[j-1])

print(max(ans))
Problem p03543 (python)

Fixed submission:
n = list(map(int,input()))
cnt = 0
f = n[0]

for i in range(4):
    if cnt == 3:
        break
    if f == n[i]:
        cnt += 1
        f = n[i]
    else:
        cnt = 0
        f = n[i]
if f == n[i]:
    cnt += 1

if cnt >= 3:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [0]*87
l[0] = 2
l[1] = 1

for i in range(2,87):
    tmp = l[i-2] + l[i-1]
    l[i] = tmp

print(l[n])
Problem p03659 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
l = [0]*n
l[0] = a[0]

for i in range(1,n):
    l[i] = l[i-1] + a[i]
sum = sum(a)
ans = 10**10+1
for i in range(len(l)-1):
    x = l[i]
    y = sum - l[i]
    tmp = abs(x-y)
    ans = min(ans,tmp)

print(ans)

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

for i in range(1,n):
    l[i] = l[i-1] + a[i]

ans = 10**9+1
for i in range(len(l)-1):
    x = l[i]
    y = sum - l[i]
    tmp = abs(x-y)
    ans = min(ans,tmp)

print(ans)
Problem p03737 (python)

Fixed submission:
a = list(map(str,input().split()))
ans = []

for i in range(3):
    tmp = list(map(str,a[i]))
    b = tmp[0]
    b = chr(ord(b)-32)
    ans.append(b)

print("".join(ans))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0
if a == b and a== c and a%2 == 0:
    print(-1)
    exit()
while a%2 == 0 and b%2 == 0 and c%2 == 0:
    cnt += 1
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt
print(cnt)
Problem p04034 (python)

Fixed submission:
import numpy as np

n,m = map(int,input().split())
l = []
for _ in range(m):
    a = list(map(int,input().split()))
    l.append(a)

memo = np.zeros((n,2))
memo[0][1] = 1

for i in range(n):
    memo[i][0] = 1

tmp1 = 0
tmp2 = 0

for j in range(m):
    tmp1 = l[j][0]-1
    tmp2 = l[j][1]-1
    memo[tmp1][0] -= 1
    memo[tmp2][0] += 1
    
    if memo[tmp2][1] == 0 and memo[tmp1][1] == 1:
        memo[tmp2][1] = 1
    
    if memo[tmp1][1] == 1 and memo[tmp1][0] == 0:
        memo[tmp1][1] = 0

ans = 0
for k in range(n):
    ans += memo[k][1]

print(int(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np

n,m = map(int,input().split())
l = []
for _ in range(m):
    a = list(map(int,input().split()))
    l.append(a)

memo = np.zeros((n,2))
memo[0][1] = 1

for i in range(n):
    memo[i][0] = 1

tmp1 = 0
tmp2 = 0

for j in range(m):
    tmp1 = l[j][0]-1
    tmp2 = l[j][1]-1
    memo[tmp1][0] -= 1
    memo[tmp2][0] += 1
    
    if memo[tmp2][1] == 0 and memo[tmp1][1] == 1:
        memo[tmp2][1] = 1
    
    if memo[tmp1][1] == 1 and memo[tmp1][0] == 0:
        memo[tmp1][1] = 0

ans = 0
for k in range(n):
    ans += memo[k][1]

print(int(ans))
Problem p02713 (python)

Fixed submission:
import numpy
import math

L = int(input())
ans = 0
for i in range(L):
    for j in range(L):
        t = math.gcd(i+1, j+1)
        for k in range(L):
            ans += math.gcd(t, k + 1)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy

L = int(input())
print(numpy.sum([math.gcd(math.gcd(i + 1, j + 1), k + 1) for i in range(L) for j in range(L) for k in range(L)]))
Problem p02923 (python)

Fixed submission:
import numpy
N = int(input())
H = list(map(int, input().split()))
Dif = numpy.array([(H[i] - H[i + 1]) for i in range(N - 1)])
Dif = numpy.append(Dif, -1)

S = list(numpy.where(Dif < 0)[0])

if len(S) == 0:
    print(0)
else:
    if len(S) == 1:
        print(S[0])
    else:
        T = [S[j + 1] - S[j] - 1 for j in range(len(S) - 1)]
        print(max(T))

Buggy submission (verdict: Runtime Error):
import numpy
N = int(input())
H = list(map(int, input().split()))
Dif = numpy.array([(H[i] - H[i + 1]) for i in range(N - 1)])
Dif = numpy.append(Dif, -1)
S = list(numpy.where(Dif <= 0)[0])
T = [S[j + 1] - S[j] - 1 for j in range(len(S) - 1)]
print(max(T))

Buggy submission (verdict: Runtime Error):
import numpy
N = int(input())
H = list(map(int, input().split()))
Dif = numpy.array([(H[i] - H[i + 1]) for i in range(N - 1)])
Dif = numpy.append(Dif, -1)
S = list(numpy.where(Dif < 0)[0])
T = [S[j + 1] - S[j] - 1 for j in range(len(S) - 1)]
print(max(T))
Problem p02924 (python)

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

Buggy submission (verdict: Runtime Error):
print(sum(range(1, N)))