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

Fixed submission:
import bisect
n =int(input())
l =list(map(int, input().split()))
l.sort()
total = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    tmp = bisect.bisect_left(l,l[i]+l[j])
    total += tmp - j - 1
print(total)

Buggy submission (verdict: Runtime Error):
import bisect
n =int(input())
l =list(map(int, input().split()))
l.sort()
total = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    tmp = bisect.bisect_left(l,l[i]+L[j])
    total += tmp - j - 1
print(total)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
l =sorted(L)
t = 0
for i in range(N-2):
  if i > 0 and l[i] = l[i-1]:
    break
  else:
    for k in range(i+1,N-1):
      for m in range(k+1, N):
        if l[m] < l[k] + l[i]:
          t += 1
        else:
          break
print(t)
Problem p02898 (python)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int,input().split()))
num = 0
for i in range(n):
  if h[i] >= k:
    num += 1
print(num)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int,input().split()))
num = 0
for i in range(n):
  if h[i] >= k:
    m += 1
print(m)
Problem p02899 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = [0]* N
for i in range(N):
    B[A[i]-1] = i + 1
print(*B)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
k=[]
for i in range(1, n + 1):
  k.append(a.index[i] + 1)
print(k[l] for l in range(n). end =' ')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
k=[]
for i in range(1, n + 1):
  k.append(a.index(i) + 1)
print(k[l] for l in range(n). end =' ')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
k=[]
for i in range(1, n + 1):
  k.insert(0, a.index(i) + 1)
print(k[l] for l in range(n). end =' ')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
k=[]
for i in range(1, n + 1):
  k.insert(0, a.index(i) + 1)
print(k[l] for i in range(n). end =' ')
Problem p02972 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
ans = [0] * N
for i in range(N):
    tmp = N - i
    kosuu = N // tmp
    if kosuu == 1:
        if a[tmp-1] == 1:
            ans[tmp-1] = 1
    else:
        sub_sum = 0
        for j in range(kosuu-1):
            sub_sum += ans[tmp * (j + 2) -1]
        if a[tmp-1] != sub_sum % 2:
            ans[tmp-1] = 1
            
true_ans = []
for i in range(N):
    if ans[i] == 1:
        true_ans.append(i + 1)
print(sum(ans))
print(*true_ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
ans = [0] * N
for i in range(N):
    tmp = N - i
    kosuu = N // tmp
    if kosuu == 1:
        if a[tmp-1] == 1:
            ans[tmp-1] = 1
    else:
        for j in range(kosuu-1):
            sub_sum += ans[tmp * (j + 2) -1]
            if a[tmp-1] != sub_sum % 2:
                ans[tmp-1] = 1

print(sum(ans))
print(*ans)
Problem p02995 (python)

Fixed submission:
import fractions
A, B, C, D = map(int, input().split())
lcm = C * D // fractions.gcd(C,D)
wari_A = (A-1) - ((A-1) // C + (A-1) // D - (A-1)//lcm)
wari_B = B - (B// C + B // D - B//lcm)
print(wari_B -wari_A)

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())
lcm = C * D // math.gcd(C,D)
wari_A = (A-1) - ((A-1) // C + (A-1) // D - (A-1)//lcm)
wari_B = B - (B// C + B // D - B//lcm)
print(wari_B -wari_A)

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())
cd = gcd(C,D)
wari_A = (A-1) - ((A-1) // C + (A-1) // D - (A-1)//cd)
wari_B = B - (B// C + B // D - B//cd)
print(wari_B -wari_A)

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())
cd = math.gcd(C,D)
wari_A = (A-1) - ((A-1) // C + (A-1) // D - (A-1)//cd)
wari_B = B - (B// C + B // D - B//cd)
print(wari_B -wari_A)
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
L = list(map(int, input().split()))
bound = 1
D = 0
i = 0
for i in range(N):
    if X >= D + L[i]:
        bound += 1
        D = D + L[i]
    else:
        break
print(bound)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))
bound = 1
D = 0
i = 0
while X >= D + L[i] and i < N:
    bound += 1
    D = D + L[i]
    i += 1
print(bound)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))
bound = 0
D = 0
i = 0
while D =< X and i < N:
    bound += 1
    D = D + L[i]
    i += 1
print(bound)
Problem p03079 (python)

Fixed submission:
A,B,C = map(int,input().split())
if A == B and B == C:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
if A == b and B == C:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input())
if A == b and B == C:
  print('Yes')
else:
  print('No')
Problem p03131 (python)

Fixed submission:
K, A, B = map(int, input().split())
if B - A <= 2 :
  print(K + 1)
elif K < A + 1:
  print(K + 1)
elif K == A + 1:
  print(B)
else:
  count = K - (A + 1)
  if count % 2 == 0:
    ans = count // 2 * (B - A) + B
  else:
    ans = count//2 * (B - A) + B + 1
  print(ans)

Buggy submission (verdict: Runtime Error):
K, A, B = map(int, input().split())
if B - A =< 2 :
  print(K + 1)
elif K < A + 1:
  print(K + 1)
else :
  ans = B 
  count = K - A - 1
  loop = count // (A + 2)
  amari = count % (A + 2)
  ans += B * loop + amari
  print(ans)

Buggy submission (verdict: Runtime Error):
K, A, B = map(int, input(),split())
if B - A =< 2 :
  print(K + 1)
elif K < A + 1:
  print(K + 1)
else :
  ans = B 
  count = K - A - 1
  loop = count // (A + 2)
  amari = count % (A + 2)
  ans += B * loop + amari
  print(ans)
Problem p03161 (python)

Fixed submission:
import numpy as np
N, K = map(int, input().split())
h = list(map(int, input().split()))
h = np.array(h)
dp = np.zeros(N, dtype = int)
for i in range(1, N):
  j = max(0,i - K)
  dp[i] = np.min(dp[j:i] + np.abs(h[i] - h[j:i]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = list(map(int, input().split()))
t = pow(10,10)
dp_h = [t] * N
dp_h[1] = abs(h[1] - h[0])
for i in range(2,N):
  for j in range(min(i, K)):
    tmp = abs(h[i] - h[i - j - 2]) + dp_h[i-j-2]
    if h[i] - h[i-j-2] == 0:
      tmp_min = tmp
      break
    if tmp < tmp_min:
      tmp_min = tmp
  dp_h[i] = tmp_min
print(dp_h[N-1])
Problem p03162 (python)

Fixed submission:
import numpy as np
N = int(input())
total = []
dp = np.zeros((N,3), dtype = int)
for i in range(N):
  tmp = list(map(int,input().split()))
  if i == 0:
    dp[i][0] = tmp[0]
    dp[i][1] = tmp[1]
    dp[i][2] = tmp[2]
  else:
    dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + tmp[0]
    dp[i][1] = max(dp[i-1][0], dp[i-1][2]) + tmp[1]
    dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + tmp[2]
print(max(dp[N-1][0],dp[N-1][1],dp[N-1][2]))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
total = []
dp = np.zeros((3,N), dtype = int)
for i in range(N):
  tmp = list(map(int,input().split()))
  if i == 0:
    dp[i][0] = tmp[0]
    dp[i][1] = tmp[1]
    dp[i][2] = tmp[2]
  else:
    dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + tmp[0]
    dp[i][1] = max(dp[i-1][0], dp[i-1][2]) + tmp[1]
    dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + tmp[2]
print(max(dp[N-1][0],dp[N-1][1],dp[N-1][2]))
Problem p03212 (python)

Fixed submission:
N = int(input())
def dfs(s):
  if int(s) > N :
    return 0
  if all(s.count(c)>0 for c in '753'):
    ret = 1
  else:
    ret = 0
  for c in '753':
    ret += dfs(s+c)
  return ret
print(dfs('0'))

Buggy submission (verdict: Runtime Error):
N = int(input())
def dfs(s): # 文字列 s で始まる七五三数の個数 if int(s) > N:
return 0
ret = 1 if all(s.count(c) > 0 for c in '753') else 0 # s 自体が七五三数なら +1 for c in '753':
         ret += dfs(s + c)
     return ret
print(dfs('0')) # 本当は dfs('') と書きたいが 4 行目でのエラーを防ぐため仕方なく
Problem p03262 (python)

Fixed submission:
import fractions
N, X = map(int, input().split())
x = list(map(int, input().split()))
tmp = abs(x[0] - X)
for i in range(1,N):
  tmp = fractions.gcd(tmp,abs(x[i]-X))
print(tmp)

Buggy submission (verdict: Runtime Error):
import math
N, X = map(int,input().split())
x = list(map(int,input().split()))
ma = 0
for i in range(N):
  ma = math.gcd(ma,abs(x[i]-X))
print(ma)

Buggy submission (verdict: Runtime Error):
import math
N, X = map(int,input().split())
x = list(map(int,input().split()))
for i in range(N):
  x[i] = abs(x[i]-X)
if N != 1:
  print(math.gcd(x))
else:
  print(x[0])
Problem p03323 (python)

Fixed submission:
if max(list(map(int,input().split()))) >8:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
if int(input())>8 or int(input())>8:
  print(":(")
else:
  print("Yay!")
Problem p03844 (python)

Fixed submission:
a=input().split()
if a[1]=="+":
  print(int(a[0])+int(a[2]))
else:
  print(int(a[0])-int(a[2]))

Buggy submission (verdict: Runtime Error):
a=input()
if a[1]=="+":
  print(int(a[0])+int(a[2]))
else:
  print(int(a[0])-int(a[2]))

Buggy submission (verdict: Runtime Error):
a=input()
if a[1]=="+":
  print(a[0]+a[2])
else:
  print(a[0]-a[2])

Buggy submission (verdict: Runtime Error):
a=input()
if a[1]=="+":
  print(a+b)
else:
  print(a-b)
Problem p03943 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a+b==c or a+c==b or b+c==a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c=int(input()),int(input()),int(input())
if a+b==c or a+c==b or b+c==a:
  print("Yes")
else:
  print("No")
Problem p02687 (python)

Fixed submission:

def main():
    s = input()
    if s == 'ABC':
        print('ARC')
    else:
        print('ABC')


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    s = input()
    if s = 'ABC':
        print('ARC')
    else:
        print('ARC')


if __name__ == "__main__":
    main()
Problem p02765 (python)

Fixed submission:

def main():
    n, r = map(int, input().split())
    if n >= 10:
        print(r)
    else:
        print(r + (100 * (10 - n)))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    n, r = map(int, input().split())
    if n >= 10:
        print(r)
    else:
        print(100 * (10 - k))


if __name__ == "__main__":
    main()
Problem p02922 (python)

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

num = 1
res = 0

while num < B:
    res += 1
    num += A-1

print(res)

Buggy submission (verdict: Runtime Error):
 = input().split()
syou = x[0] / x[1]
amari = x[0] % x[1]

if(amari > 0 ):
    print(syou+1)
else:
    print(syou)
Problem p02999 (python)

Fixed submission:

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

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    x, a = map(int, input().split())
    if x < a:
        print(0)
    else:
        print(10i)
   

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    x, a = map(int, input().split())
    if x < 0:
        print(0)
    elif x >= a:
        print(10i)
    

if __name__ == "__main__":
    main()
Problem p03035 (python)

Fixed submission:

def main():
    a, b = map(int, input().split())
    if a >= 13:
        print(b)
    elif 6 <= a <= 12:
        print(b // 2)
    else:
        print(0)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    a, b = map(int, input())
    if a >= 13:
        print(b)
    elif 6 <= a <= 12:
        print(b // 2)
    else:
        print(0)


if __name__ == "__main__":
    main()
Problem p03125 (python)

Fixed submission:
def main():
    a, b = map(int, input().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    a, b = map(int, input().split())
    if b / a % 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    a, b = map(int, input().split())
    if b / a %i 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == "__main__":
    main()
Problem p03238 (python)

Fixed submission:

def main():
    n = int(input())
    if n == 1:
        print('Hello World')
    else:
        a = int(input())
        b = int(input())
        print(a + b)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    n = int(input())
    a = int(input())
    b = int(input())
    if n == 1:
        print('Hello World')
    else:
        print(a + b)


if __name__ == "__main__":
    main()
Problem p03284 (python)

Fixed submission:

def main():
    x, y = map(int, input().split())
    if x % y != 0:
        print(abs((x // y + 1) - (x // y)))
    else:
        print(abs((x // y) - (x // y)))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    x, y = map(int, input().split())
    print(abs((x // y + x % y) - (x // y)))


if __name__ == "__main__":
    main()
i
Problem p03447 (python)

Fixed submission:

def main():
    x = int(input())
    a = int(input())
    b = int(input())
    print((x - a) - (b * ((x - a) // b)))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    x = int(input())
    a = int(input())
    b = int(input())
    print((x - a) - (b * ((x - a) // b)))


if __name__ == "__main__":
    main()
i
Problem p03485 (python)

Fixed submission:

import math


def main():
    x, y = map(int, input().split())
    print(math.ceil((x + y) / 2))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

import math


def main():
    x, y = map(int, input())
    print(math.floor((x + y) / 2))


if __name__ == "__main__":
    main()
Problem p03826 (python)

Fixed submission:

def main():
    a, b, c, d = map(int, input().split())
    if a*b >= c*d:
        print(a*b)
    else:
        print(c*d)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    a, b, c, d = map(int, input())
    if a*b >= c*d:
        print(a*b)
    else:
        print(c*d)


if __name__ == "__main__":
    main()
Problem p03844 (python)

Fixed submission:

def main():
    n = input().split()
    if n[1] == '+':
        print(int(n[0]) + int(n[2]))
    else:
        print(int(n[0]) - int(n[2]))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    n = input().split()
    if n[1] == '+':
        print(int(n[0]) + int(n[1]))
    else:
        print(int(n[0]) - int(n[1]))


if __name__ == "__main__":
    main()
Problem p04043 (python)

Fixed submission:

def main():
    a, b, c = map(int, input().split())
    if a + b + c == 17:
        print('YES')
    else:
        print('NO')


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    a, b, c = map(int, input().split())
    if sum(a, b, c) == 17:
        print('YES')
    else:
        print('NO')


if __name__ == "__main__":
    main()
Problem p02830 (python)

Fixed submission:
n = int(input())
s,t =  input().split()
for (ele,mele) in zip(s,t):
    print(ele+mele,end="")

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

for (ele,mele) in zip(s,t):
    print(ele+mele,end="")
Problem p02947 (python)

Fixed submission:
n = int(input())
s = [list(input()) for _ in range(n)]
ans = 0
sd = dict([])

for i in s:
    key = ''.join(sorted(i))
    sd.setdefault(key, 0)
    sd[key] += 1
    
for v in sd.values():
    ans += v * (v - 1) // 2
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [list(input()) for _ in range(n)]
ans = 0
sd = dict([])

for i in s:
    key = ''.join(sorted(i))
    sd.setdefault(key, 0)
    sd[key] += 1
    
for v in s_dict.values():
    ans += v * (v - 1) // 2
print(ans)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
A, B, C, D = map(int, input().split())

def lcm(x, y):
    return x * y // gcd(x, y)

def F(a, c, d):
    x = a - a//c - a//d + a//lcm(c, d)
    return x

ans = int(F(B, C, D) - F(A-1, C, D))
print(ans)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
A, B, C, D = map(int, input().split())

def lcm(x, y):
    return x * y // math.gcd(x, y)

def F(a, c, d):
    x = a - a//c - a//d + a//lcm(c, d)
    return x

ans = int(F(B, C, D) - F(A-1, C, D))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())

def lcm(x, y):
    return x * y // math.gcd(x, y)

def F(a, c, d):
    x = a - a//c - a//d + a//lcm(c, d)
    return x

ans = int(F(B, C, D) - F(A-1, C, D))
print(ans)
Problem p03086 (python)

Fixed submission:
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = [0] * len(S)

for i in range(len(S)):
    if S[i] in ACGT:
        cnt = 1
        for j in range(len(S) - i - 1):
            if S[i+j+1] in ACGT:
                cnt += 1
            else:
                ans[i] = cnt
                break
        ans[i] = cnt

print(max(ans))

Buggy submission (verdict: Runtime Error):
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = [0] * len(S)

for i in range(len(S)):
    if S[i] in ACGT:
        cnt = 1
        for j in range(len(S) - i):
            if S[i+j+1] in ACGT:
                cnt += 1
            else:
                ans[i] = cnt
                break

print(max(ans))
Problem p03324 (python)

Fixed submission:
import sys

get = sys.stdin.readline()
a, b = get.split(" ")
a2 = int(a)
b2 = int(b)
ans = 0
if(b2 == 100):
    ans = (b2+1) * (10 ** (a2*2))
else:
    ans = b2 * (10 ** (a2*2))
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

get = sys.stdin.readline()
a, b = get.split(" ")
a2 = long(a)
b2 = long(b)
ans = b2 * (10 ** (a2*2))
print(ans)
Problem p02719 (python)

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

ans1 = n%k
ans2 = k - n%k

if ans1 > ans2:
  print(ans2)
else:
  print(ans1)

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

ans1 = n%abs(n-k)
ans2 = abs(n-k)%k

if ans1 > ans2:
  print(ans2)
else:
  print(ans1)
Problem p02761 (python)

Fixed submission:
n,m = map(int,input().split())
c1 = []
c2 = []
c3 = []
for i in range(m):
  sc = list(map(int,input().split()))
  if sc[0] == 1:
    c1.append(sc[1])
  elif sc[0] == 2:
    c2.append(sc[1])
  else:
    c3.append(sc[1])

if len(set(c1)) <= 1 and len(set(c2)) <= 1 and len(set(c3)) <= 1:
  if 0 in list(set(c1)):
    if n == 1 and len(set(c1)) == 1 and len(set(c2)) == 0 and len(set(c3)) == 0:
      print('0')
      exit()
    else:
      print('-1')
      exit()
  elif not c1 and not c2 and not c3:
    if n == 1:
      print('0')
      exit()
    elif n == 2:
      print('10')
      exit()
    else:
      print('100')
      exit()
  else:
    if list(set(c1)):
      ans_c1 = list(set(c1))[0]
    else:
      ans_c1 = 1
    if list(set(c2)):
      ans_c2 = list(set(c2))[0]
    else:
      ans_c2 = 0
    if list(set(c3)):
      ans_c3 = list(set(c3))[0]
    else:
      ans_c3 = 0
else:
  print('-1')
  exit()

if n == 1:
  print(ans_c1)
elif n == 2:
  print(ans_c1*10 + ans_c2)
else:
  print(ans_c1*100 + ans_c2*10 + ans_c3)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
sc = []
for i in range(m):
  sc.append(list(map(int,input().split())))

sc1 = []
sc2 = []
sc3 = []
for i in sc:
  if i[0]==1:
    sc1.append(i[1])
  elif i[0]==2:
    sc2.append(i[1])
  else:
    sc3.append(i[1])

if len(set(sc1)) > 1 or len(set(sc2)) > 1 or len(set(sc3)) > 1:
  print('-1')
  exit()
elif len(set(sc1)) <= 1 and list(set(sc1))[0] == 0:
  print('-1')
  exit()


c1 = list(set(sc1))
c2 = list(set(sc2))
c3 = list(set(sc3))

if c1:
  c1_ans = c1[0]
else:
  c1_ans = 1
if c2:
  c2_ans = c2[0]
else:
  c2_ans = 0
if c3:
  c3_ans = c3[0]
else:
  c3_ans = 0

print(100*c1_ans + 100*c2_ans + c3_ans)

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

if m==0:
  print(0)
  exit()

s = []
c = []
for i in range(m):
  sc = input().replace(' ','')
  s.append(int(sc[-2]))
  c.append(int(sc[-1]))

s1 = []
s2 = []
s3 = []
c1 = []
c2 = []
c3 = []
for i in range(m):
  if s[i] == 1 and not s1:
    s1.append(s[i])
    c1.append(c[i])
  elif s[i] == 1 and s1 and c[i] == c1[0]:
    next
  elif s[i] == 1 and s1 and c[i] != c1[0]:
    print(-1)
    exit()
  elif s[i] == 2 and not s2:
    s2.append(s[i])
    c2.append(c[i])
  elif s[i] == 2 and s2 and c[i] == c2[0]:
    next
  elif s[i] == 2 and s2 and c[i] != c2[0]:
    print(-1)
    exit()
  elif s[i] == 3 and not s3:
    s3.append(s[i])
    c3.append(c[i])
  elif s[i] == 3 and s3 and c[i] == c3[0]:
    next
  elif s[i] == 3 and s3 and c[i] != c3[0]:
    print(-1)
    exit()
ans = 0
if c1[0]==0:
  print(-1)
  exit()
elif not c1:
  next
else:
  ans+=c1[0]*100

if not c2:
  next
else:
  ans+=c2[0]*10

if not c3:
  next
else:
  ans+=c3[0]

print(ans)
Problem p02765 (python)

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

if n >= 10:
  print(r)
else:
  print(r+ 100*(10 - n))

Buggy submission (verdict: Runtime Error):
n = int(input())
x = input().split(' ')

p = 0
ans = []
while p <= int(x[n-1]):
  e = 0
  for i in range(n):
    e += (int(x[i])-p)**2
  ans.append(e)
  p+=1
print(min(ans))
Problem p02683 (python)

Fixed submission:
import numpy as np
import itertools
N, M, X = map(int, input().split())
kumi = []
pat = list(range(N))
for _ in range(N):
    kumi.append(list(map(int, input().split())))
ans = 10 ** 5 * 12
kai = False
test = []
for i in range(N):
    for i2 in itertools.combinations(kumi,i+1):
        arr_i2 = np.array(i2)
        arr_i2_sum = arr_i2.sum(axis = 0)
        if np.all(arr_i2_sum[1:] >= X):
            if ans >= arr_i2_sum[0]:
                ans = arr_i2_sum[0]
                kai = True
if kai:
    print(ans)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
N, M, X = map(int, input().split())
kumi = []
pat = list(range(N))
for _ in range(N):
    kumi.append(list(map(int, input().split())))
ans0 = 10 ** 5 * 12 + 1
ans = 10 ** 5 * 12 + 1
#print(kumi)
test = []
for i in range(N):
    for i2 in itertools.combinations(kumi,i+1):
        arr_i2 = np.array(i2)
        arr_i2_sum = arr_i2.sum(axis = 0)
        if np.all(arr_i2_sum[1:] >= X):
            if ans > arr_i2_sum[0]:
                ans = arr_i2_sum[0]
if ans == ans0:
    print(-1)
else:
    print(ans)import numpy as np
import itertools
N, M, X = map(int, input().split())
kumi = []
pat = list(range(N))
for _ in range(N):
    kumi.append(list(map(int, input().split())))
ans0 = 10 ** 5 * 12 + 1
ans = 10 ** 5 * 12 + 1
#print(kumi)
test = []
for i in range(N):
    for i2 in itertools.combinations(kumi,i+1):
        arr_i2 = np.array(i2)
        arr_i2_sum = arr_i2.sum(axis = 0)
        if np.all(arr_i2_sum[1:] >= X):
            if ans > arr_i2_sum[0]:
                ans = arr_i2_sum[0]
if ans == ans0:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
N, M, X = map(int, input().split())
kumi = []
pat = list(range(N))
for _ in range(N):
    kumi.append(list(map(int, input().split())))
ans0 = 10 ** 5 * 12
ans = 10 ** 5 * 12
#print(kumi)
test = []
for i in range(N):
    for i2 in itertools.combinations(kumi,i+1):
        arr_i2 = np.array(i2)
        arr_i2_sum = arr_i2.sum(axis = 0)
        #print(arr_i2_sum[1:] >= X)
        if np.all(arr_i2_sum[1:] >= X):
            if ans > arr_i2_sum[0]:
                ans = arr_i2_sum[0]
if ans == ans0:
    print(-1)
else:
    print(ans)