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

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

d = {1:300000, 2:200000, 3:100000}

if x == 1 and y == 1:
	print(10**6)
	exit()

su = 0
if x in d:
	su += d[x]
if y in d:
	su += d[y]
print(su)

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())

d = {1:300000, 2:200000, 3:100000}

if x == 1 and y == 1:
	print(10**6)
	exit()

su = 0
if x in d:
	su += d[x]
if y in d:
	su += d[x]
print(su)
Problem p02582 (python)

Fixed submission:
S = input()
if S == "RRR":
  print(3)
elif "RR" in S:
  print(2)
elif "R" in S:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
S = input()
if S = "RRR":
  print(3)
elif "RR" in S:
  print(2)
elif "R" in S:
  print(1)
else:
  print(0)
Problem p02601 (python)

Fixed submission:
x = input()
k = int(input())
x = x.split()
y = [int(s) for s in x]
dict = {"red":0, "green":0}
dict["red"] = y[0]
dict["green"] = y[1]
count = 0
if dict["red"] < dict["green"]:
      pass
else:
  for N in range(k):
    count += 1
    dict["green"] = dict["green"] * 2
    if dict["red"] < dict["green"]:
        break
    else:
        continue
dict["blue"] = y[2]
if k - count == 0:
  if dict["green"] > dict["blue"]:
    pass
  else:
    print("Yes")
    exit()
else:
  pass
i = k - count
if dict["green"] < dict["blue"]:
  print("Yes")
  exit()
else:
  for N in range(i):
    dict["blue"] = dict["blue"] * 2
    if dict["green"] < dict["blue"]:
      print("Yes")
      exit()
    else:
        continue
print("No")

Buggy submission (verdict: Runtime Error):
x = input()
k = int(input())
x = x.split()
y = [int(s) for s in x]
dict = {"red":0, "green":0}
dict["red"] = y[0]
dict["green"] = y[1]
count = 0
if dict["red"] < dict["green"]:
      pass
else:
  for N in range(k):
    count += 1
    dict["green"] = dict["green"] * 2
    if dict["red"] < dict["green"]:
        break
    else:
        continue
if k - count == 0:
  if dict["green"] < dict["blue"]:
    print("No")
  else:
    print("Yes")
else:
  pass
i = k - count
dict["blue"] = y[2]
if dict["green"] < dict["blue"]:
  print("Yes")
  exit()
else:
  for N in range(i):
    dict["blue"] = dict["blue"] * 2
    if dict["green"] < dict["blue"]:
      print("Yes")
      exit()
    else:
        continue
print("No")
Problem p02608 (python)

Fixed submission:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
      if v<10050:
        ans[v]+=1
for i in range(n):
  print(ans[i+1])

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
      if v<10050:
        ans[v]+=1
for i in range(n):
print(ans[i+1])

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
    if v<10050:
      ans[v]+=1
for i in range(n):
print(ans[i+1])
Problem p02612 (python)

Fixed submission:
N = int(input())
if N % 1000 == 0:
  print(0)
else:
  a = N % 1000
  print(1000 - a)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N % 1000 = 0:
  print(0)
else:
  a = N % 1000
  print(1000 - a)

Buggy submission (verdict: Runtime Error):
a = input()
b = a % 1000
print(b)
Problem p02614 (python)

Fixed submission:
H, W, K = map(int, input().split())
lis = []
ans = 0
for i in range(H):
  lis.append(list(input()))
for i in range(1<<H):
  for j in range(1<<W):
    cnt = 0
    for p in range(H):
      for q in range(W):
        if (i>>p) & 1:
          continue
        if (j>>q) & 1:
          continue
        if lis[p][q] == "#":
          cnt += 1
    if cnt == K:
      ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
H, W, K = map(int, input().split())
lis = []
ans = 0
for i in range(H):
  lis.append(list(map(int, input().split())))
for i in range(1<<H):
  for j in range(1<<W):
    cnt = 0
    for p in range(H):
      for q in range(W):
        if (i>>p) & 1:
          continue
        if (j>>q) & 1:
          continue
        if lis[p][q] == "#":
          cnt += 1
    if cnt == K:
      ans += 1
print(ans)
Problem p02630 (python)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
su = sum(A)
counter = Counter(A)
lis = {}
for i in range(Q):
  B, C = map(int, input().split())
  su -= B * counter[B]
  su += C * counter[B]
  counter[C] += counter[B]
  counter[B] = 0
  print(su)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
su = sum(A)
print(counter)
lis = {}
for i in range(Q):
  B, C = map(int, input().split())
  su -= B * counter[B]
  su += C * counter[B]
  counter[C] += counter[B]
  counter[B] = 0
  print(su)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
lis = [0] * (10**5)
Q = int(input())
for x in A:
  lis[x] += 1 * x
for i in range(Q):
  B, C = map(int, input().split())
  try:
    temp = lis[B] // B
    lis[B] = 0
    lis[C] += temp * C
  except:
    pass
  print(sum(lis))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
lis = [0] * (10**5)
Q = int(input())
for x in A:
  lis[x] += 1 * x
for i in range(Q):
  B, C = map(int, input().split())
  try:
    temp = lis[B] // B
    lis[B] = 0
    lis[C] += temp * C
  except:
    pass
  print(sum(lis))
Problem p02681 (python)

Fixed submission:
s=input()
t=input()
if s in t[0:len(s)] and len(t) == len(s)+1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
if s in t and len(t) == len(s)+1:
  print(“Yes”)
else:
  print(“No”)
Problem p02705 (python)

Fixed submission:
import math
 
R = int(input())
ans = R * 2 * math.pi
print(ans)

Buggy submission (verdict: Runtime Error):
import math

R = int(input())
ans = R ** 2 math.pi
print(ans)
Problem p02730 (python)

Fixed submission:
def check(a):
  for i in range(int(len(a)/2)):
    if a[i]!=a[-(i+1)]:
       return False
  return True
 
S=input()
if check(S):
  a=S[0:int(len(S)/2)]
  b=S[int(len(S)/2)+1:len(S)]
  if check(a) and check(b):
    print('Yes')
  else:
    print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
def check(a):
  for i in range(int(len(a)/2)):
    if a[i]!=a[-(i+1)]:
       return False
  return True

S=input()
if kaibun(S):
  a=S[0:int(len(S)/2)]
  b=S[int(len(S)/2)+1:len(S)]
  if kaibun(a) and kaibun(b):
    print('Yes')
  else:
    print('No')
else:
    print('No')
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
lis = {}
if N == 1 and M == 0:
  print(0)
  exit()
if N == 2 and M == 0:
  print(10)
  exit()
if N == 3 and M == 0:
  print(100)
  exit()
if N == 1 and M == 1:
  s, c = map(int, input().split())
  print(c)
  exit()
for i in range(M):
  s, c = map(int, input().split())
  if s == 1 and c == 0:
    print(-1)
    exit()
  if s in lis:
    if lis[s] == c:
      continue
    else:
      print(-1)
      exit()
  else:
    lis[s] = c
if not 1 in lis:
  lis[1] = 1
for i in range(2, N+1):
  if not i in lis:
    lis[i] = 0
ans = ""
for i in range(1, N+1):
  ans += str(lis[i])
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
lis = {}
if N == 1:
  s, c = map(int, input().split())
  print(c)
  exit()
for i in range(M):
  s, c = map(int, input().split())
  if s == 1 and c == 0:
    print(-1)
    exit()
  if s in lis:
    if lis[s] == c:
      continue
    else:
      print(-1)
      exit()
  else:
    lis[s] = c
if not 1 in lis:
  lis[1] = 1
for i in range(2, N+1):
  if not i in lis:
    lis[i] = 0
ans = ""
for i in range(1, N+1):
  ans += str(lis[i])
print(ans)
Problem p02772 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = True
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] % 3 != 0 and A[i] % 5 != 0:
      ans = False
if ans:
  print("APPROVED")
else:
  print("DENIED")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input.split()))
ans = True
for i in range(N):
  if A[i] % 2 == 0:
    if A[i] % 3 != 0 or A[i] % 5 != 0:
      ans = False
if ans:
  print("APPROVED")
else:
  print("DENIED")
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())
ans = H // A
if H % A != 0:
  ans = ans + 1
print(ans)

Buggy submission (verdict: Runtime Error):
H, A = map(int, input.split())
ans = H // A
if H % A != 0:
  ans = ans + 1
print(ans)
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
ans = 0
for i in range(3):
  if S[i] == T[i]:
    ans +=1
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
ans = 0
for i in range(N):
  if S[i] == T[i]:
    ans +=1
print(ans)
Problem p02953 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.reverse()
ans = "Yes"
for i in range(N-1):
  if A[i] >= A[i+1]:
    continue
  elif A[i] == A[i+1] - 1:
    A[i+1] = A[i]
  else:
    ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = True
lis = {}
for i in H:
  if i in lis:
    lis[i] += 1
  else:
    lis[i] = 1
mine = min(H)
times = lis[mine]
for i in range(N):
  if mine < H[i]-1:
    ans = False
    break
  else:
    if H[i] == mine:
      times -= 1
    if times == 0 and i != N-1:
      del lis[mine]
      lis = sorted(lis)
      mine = next(iter(lis))
      times = lis[next(iter(lis))]
if ans:
  print("Yes")
else:
  print("No")
Problem p02994 (python)

Fixed submission:
N, L = map(int, input().split())
A = []
for i in range(N):
  A.append(L+i)
i = 0
ans = False
while ans == False:
    x, y = abs(i), -abs(i)
    for k in A:
      if k == x or k == y:
        ans = True
        A.remove(k)
    i += 1
print(sum(A))

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
A = []
for i in range(N):
  A.append(L+i)
i = 0
for k in A:
  if i == 0:
    x = 0
  else:
    x, y = abs(i), -abs(i)
  i += 1
  for
Problem p03001 (python)

Fixed submission:
W, H, x, y = map(int, input().split())
ans1 = W * H / 2
cen_x, cen_y = W/2, H/2
if cen_x == x and cen_y == y:
  ans2 = 1
else:
  ans2 = 0
print(str(ans1) + " " + str(ans2))

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
ans1 = W * H / 2
cen_x, cen_y = W/2, H/2
if cen_x == x and cen_y == y:
  ans2 = 1
else:
  ans2 = 0
print(ans1 + " " + ans2)
Problem p02714 (python)

Fixed submission:
# author:  Taichicchi
# created: 19.09.2020 00:14:21

import sys

N = int(input())

S = input()

ans = S.count("R") * S.count("G") * S.count("B")


for i in range(N - 2):
    for j in range(i + 1, N - 1):
        try:
            k = 2 * j - i
            if (S[i] != S[j]) & (S[j] != S[k]) & (S[k] != S[i]):
                ans -= 1
        except:
            continue

print(ans)

Buggy submission (verdict: Runtime Error):
# author:  Taichicchi
# created: 19.09.2020 00:14:21

from collections import Counter
import sys
from math import prod

N = int(input())

S = input()


c = Counter(S)

ans = prod(list(c.values()))

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            if j - i == k - j:
                if (S[i] != S[j]) & (S[j] != S[k]) & (S[k] != S[i]):
                    ans -= 1

print(ans)
Problem p02993 (python)

Fixed submission:
result = "Good"
s = list(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    result = "Bad"
print(result)

Buggy submission (verdict: Runtime Error):
import fractions

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

s = B - A + 1

if A % C == 0 or A % D == 0:
    A -= 1

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

E = lcm(C, D)

val1 = A // C
val2 = B // C
val3 = A // D
val4 = B // D
val5 = A // E
val6 = B // E

print(s - (val2 - val1 + val4 - val3 - (val6 - val5)))

Buggy submission (verdict: Runtime Error):
import math

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

s = B - A + 1

if A % C == 0 or A % D == 0:
    A -= 1

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

E = lcm(C, D)

val1 = A // C
val2 = B // C
val3 = A // D
val4 = B // D
val5 = A // E
val6 = B // E

print(s - (val2 - val1 + val4 - val3 - (val6 - val5)))
Problem p02999 (python)

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

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

cnt = 0
def main():
  for i in range(N):
      for j in range(i + 1, N + 1):
          s = sum(a[i:j])
          if s >= K:
              cnt += N - ( j - 1 )
              break
  print(cnt)

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

Fixed submission:
A, B = list(map(int,input().split()))
def button(A, B):
  if A > B:
    result = A
    return([A - 1, B, result])
  elif A == B:
    result = A
    return([A - 1, B, result])
  else:
    result = B
    return([A, B - 1, result])
 
A, B, result_1 = button(A, B)
A, B, result_2 = button(A, B)
 
print(result_1 + result_2)

Buggy submission (verdict: Runtime Error):
A, B = list(map(int,input()))
def button(A, B):
  if A > B:
    result = A
    return([A - 1, B, result])
  elif A == B:
    result = A
    return([A - 1, B, result])
  else:
    result = B
    return([A, B - 1, result])
 
A, B, result_1 = button(A, B)
A, B, result_2 = button(A, B)
 
print(result_1 + result_2)

Buggy submission (verdict: Runtime Error):
A, B = list(map(int,input()))
def button(A, B):
  if A > B:
    result = A
    return([A - 1, B, result])
  elif A = B:
    result = A
    return([A - 1, B, result])
  else:
    result = B
    return([A, B - 1, result])

A, B, result_1 = button(A, B)
A, B, result_2 = button(A, B)

print(result_1 + result_2)
Problem p03076 (python)

Fixed submission:
ts = []
ts_mod = []
for i in range(5):
    ts.append(int(input()))
    ts_mod.append(ts[i] % 10)


def find_index(ts, ts_mod):
    if all([x == 0 for x in ts_mod]):
        return 0
    else:
        result = 10
        for i in range(len(ts_mod)):
            if ts_mod[i] == 0:
                pass
            else:
                if result > ts_mod[i]:
                    result = ts_mod[i]
        return ts_mod.index(result)

min_ind = find_index(ts, ts_mod)

last_ts = ts[min_ind]

del ts_mod[min_ind]
del ts[min_ind]


result = 0
for i in range(len(ts_mod)):
    if ts[i] % 10 == 0:
        result += ts[i]
    else:
        result += ts[i] + ( 10 - ts[i] % 10 )
        
result += last_ts
print(result)

Buggy submission (verdict: Runtime Error):
ts = []
ts_mod = []
for i in range(5):
    ts.append(int(input()))
    ts_mod.append(ts[i] % 10)


def find_index(ts, ts_mod):
    result = 10
    for i in range(len(ts_mod)):
        if ts_mod[i] == 0:
            pass
        else:
            if result > ts_mod[i]:
                result = ts_mod[i]
    return ts_mod.index(result)

min_ind = find_index(ts, ts_mod)

last_ts = ts[min_ind]

del ts_mod[min_ind]
del ts[min_ind]


result = 0
for i in range(len(ts_mod)):
    if ts[i] % 10 == 0:
        result += ts[i]
    else:
        result += ts[i] + ( 10 - ts[i] % 10 )
        
result += last_ts
print(result)
Problem p03125 (python)

Fixed submission:
A, B = list(map(int,input().split()))
if B % A == 0:
  print( A + B )
else:
  print( B - A )

Buggy submission (verdict: Runtime Error):
A, B = list(map(int, input()))

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

Fixed submission:
import sys


def dfs(v):
    global visited
    visited[v] = True
    for nv in graph[v]:
        if nv in graph[v]:
            if not visited[nv]:
                dfs(nv)


if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    N, M = map(int, input().split())
    graph = [[] for _ in range(N)]
    visited = [False]*N
    for _ in range(M):
        A, B = map(lambda x: int(x)-1, input().split())
        graph[A].append(B)
        graph[B].append(A)
    ans = -1
    for v in range(N):
        if not visited[v]:
            dfs(v)
            ans += 1
    print(ans)

Buggy submission (verdict: Runtime Error):
def dfs(v):
    global visited
    visited[v] = True
    for nv in graph[v]:
        if nv in graph[v]:
            if not visited[nv]:
                dfs(nv)


if __name__ == "__main__":
    N, M = map(int, input().split())
    graph = [[] for _ in range(N)]
    visited = [False]*N
    for _ in range(M):
        A, B = map(lambda x: int(x)-1, input().split())
        graph[A].append(B)
        graph[B].append(A)
    ans = -1
    for v in range(N):
        if not visited[v]:
            dfs(v)
            ans += 1
    print(ans)
Problem p02936 (python)

Fixed submission:
import sys


def count(i, r, value):
    value += rc[i]
    counter[i] = value
    for e in es[i]:
        if e != r:
            count(e, i, value)


if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    N, Q = map(int, input().split())
    es = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a-1].append(b-1)
        es[b-1].append(a-1)
    counter = [0]*N
    rc = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        rc[p-1] += x
    count(0, -1, 0)
    print(*counter)

Buggy submission (verdict: Runtime Error):
import sys


def count(i, r):
    counter[i] += counter[r] if r >= 0 else 0
    for e in es[i]:
        count(e, i)


if __name__ == "__main__":
    sys.setrecursionlimit(2*(10**5))
    input = sys.stdin.readline
    N, Q = map(int, input().split())
    es = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a-1].append(b-1)
    counter = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        counter[p-1] += x
    count(0, -1)
    print(*counter)

Buggy submission (verdict: Runtime Error):
import sys


def count(i, c):
    counter[i] = c+rc[i]
    for e in es[i]:
        if counter[e] == 0:
            count(e, counter[i])


if __name__ == "__main__":
    sys.setrecursionlimit(2*(10**5))
    input = sys.stdin.readline
    N, Q = map(int, input().split())
    es = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a-1].append(b-1)
    counter = [0]*N
    rc = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        rc[p-1] += x
    count(0, 0)
    print(*counter)

Buggy submission (verdict: Runtime Error):
import sys


def count(i, x):
    counter[i] += x
    for e in es[i]:
        count(e, x)


if __name__ == "__main__":
    sys.setrecursionlimit(2*(10**5))
    N, Q = map(int, input().split())
    es = [[] for _ in range(N+1)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a].append(b)
    counter = [0 for _ in range(N+1)]
    for _ in range(Q):
        p, x = map(int, input().split())
        count(p, x)
    for i in range(1, N+1):
        if i == N:
            print(counter[i], end="\n")
        else:
            print(counter[i], end=" ")
Problem p02994 (python)

Fixed submission:
N, L = (int(nl) for nl in input().split())
tastes = [L+i-1 for i in range(1, N+1)]
min_taste = 100
min_taste_abs = 100
for taste in tastes:
    if min_taste_abs >= abs(taste):
        min_taste_abs = abs(taste)
        min_taste = taste

min_taste_index = tastes.index(min_taste)
if len(tastes) == min_taste_index+1:
    print(sum(tastes[:min_taste_index]))
else:
    print(sum(tastes[:min_taste_index]+tastes[min_taste_index+1:]))

Buggy submission (verdict: Runtime Error):
N, L = (int(nl) for nl in input().split())
tastes = [L+i-1 for i in range(1, N+1)]
min_taste = 0
min_taste_abs = 100
for taste in tastes:
    if min_taste_abs > abs(taste):
        min_taste_abs = abs(taste)
        min_taste = taste

min_taste_index = tastes.index(min_taste)
if len(tastes) == min_taste_index+1:
    print(sum(tastes[:min_taste_index]))
else:
    print(sum(tastes[:min_taste_index]+tastes[min_taste_index+1:]))

Buggy submission (verdict: Runtime Error):
N, L = (int(nl) for nl in input().split())
tastes = [L+i-1 for i in range(1, N+1)]
min_taste = 0
min_taste_abs = 100
for taste in tastes:
    if min_taste_abs > abs(taste):
        min_taste_abs = abs(taste)
        min_taste = taste
min_taste_index = tastes.index(min_taste)
print(sum(tastes[:min_taste_index]+tastes[min_taste_index+1:]))

Buggy submission (verdict: Runtime Error):
N, L = (int(nl) for nl in input().split())
tastes = [L+i-1 for i in range(1, N+1)]
min_taste = 0
min_taste_abs = 100
for taste in tastes:
    if min_taste_abs > abs(taste):
        min_taste_abs = abs(taste)
        min_taste = taste

min_taste_index = tastes.index(min_taste)
print(sum(tastes[:min_taste_index]+tastes[min_taste_index+1:]))
Problem p02657 (python)

Fixed submission:
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    A, B = map(int, input().split())
    print(A * B)


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
%%cython
cdef int solve(int a, int b):
    return a*b

def main():
    a, b = map(int, input())
    print(solve(a,b))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
cdef int solve(int a, int b):
    return a*b

def main():
    a, b = map(int, input())
    print(solve(a,b))

if __name__ == '__main__':
    main()
Problem p02677 (python)

Fixed submission:
import numpy as np
import math

A, B, H, M = map(int, input().split())

time = H + (M / 60.0)
a_rot = (time / 12.0) * np.pi * 2
b_rot = (M / 60.0) * np.pi * 2

rot = a_rot - b_rot
if rot < 0:
    rot = b_rot - a_rot


ans = math.sqrt(A**2 + B**2 - (2 * A * B * np.cos(rot)))

print(ans)

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

A, B, H, M = map(int, input().split())

time = H + (M / 60.0)
a_rot = (time / 12.0) * np.pi * 2
b_rot = (M / 60.0) * np.pi * 2

rot = a_rot - b_rot
if rot < 0:
    rot = b_rot - a_rot


ans = math.sqrt(A**2 + B**2 - (2 * A * B * np.cos(rot)))

print(ans)
Problem p02678 (python)

Fixed submission:
from collections import deque

N, M = map(int, input().split())

links = [[] for _ in range(N + 1)]

for _ in range(M):
    A, B = map(int, input().split())
    links[A].append(B)
    links[B].append(A)

dist = [-1] * (N + 1)
michi = [-1] * (N + 1)
dist[1] = 0
q = deque([1])

while q:
    now = q.popleft()
    for i in links[now]:
        if dist[i] == -1:
            dist[i] = dist[now] + 1
            michi[i] = now
            q.append(i)

print('Yes')
for i in range(2, N + 1):
    print(michi[i])

Buggy submission (verdict: Runtime Error):
# from collections import deque
# from collections import defaultdict
import itertools
# import math
# import numpy as np
# from scipy.special import comb
# import heapq


def main():
    N, W = map(int, input().split())
    v = [0] * (N + 1)
    w = [0] * (N + 1)

    for i in range(1, N + 1):
        v[i], w[i] = map(int, input().split())

    values = [[0 for _ in range(W + 1)] for _ in range(N + 1)]

    for i in range(0, N + 1):
        for j in range(0, W + 1):
            non_choice = values[i - 1][j]
            if j >= w[i]:
                choice = values[i - 1][j - w[i]] + v[i]
            else:
                choice = 0
            values[i][j] = max(choice, non_choice)

    print(max(list(itertools.chain(*values))))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# from collections import deque
# from collections import defaultdict
# import itertools
# import math
import numpy as np
# from scipy.special import comb
# import heapq


def main():
    N, W = map(int, input().split())
    v = [0] * (N + 1)
    w = [0] * (N + 1)

    for i in range(1, N + 1):
        v[i], w[i] = map(int, input().split())

    values = [[0 for _ in range(W + 1)] for _ in range(N + 1)]

    for i in range(0, N + 1):
        for j in range(0, W + 1):
            non_choice = values[i - 1][j]
            if j >= w[i]:
                choice = values[i - 1][j - w[i]] + v[i]
            else:
                choice = 0
            values[i][j] = max(choice, non_choice)

    print(np.max(np.array(values)))


if __name__ == '__main__':
    main()