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

Fixed submission:
import sys

sys.setrecursionlimit(2000000)


def update(M, S, i, j, H, W, cluster):
    for i_n in [i - 1, i, i + 1]:
        for j_n in [j - 1, j, j + 1]:
            if i_n >= H or i_n < 0:
                continue
            if j_n >= W or j_n < 0:
                continue

            if i_n == i and j_n == j:
                continue
            if abs(i - i_n) + abs(j - j_n) == 2:
                continue

            if S[i][j] != S[i_n][j_n] and M[i_n][j_n] == 0:
                # print(M)
                M[i_n][j_n] = cluster
                update(M, S, i_n, j_n, H, W, cluster)


H, W = list(map(int, input().split()))
S = []
for i in range(H):
    S.append(input().strip())

cluster = 1
counts_B = {}
counts_W = {}
M = [[0 for j in range(W)] for i in range(H)]
for i in range(H):
    for j in range(W):
        if M[i][j] == 0:
            M[i][j] = cluster
            update(M, S, i, j, H, W, cluster)
            cluster = cluster + 1
        counts_B[M[i][j]] = 0
        counts_W[M[i][j]] = 0


for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            counts_B[M[i][j]] += 1
        else:
            counts_W[M[i][j]] += 1

    #     print(M[i][j], end=" ")
    # print("")

total = 0
for k in counts_B.keys():
    if k in counts_W:
        total += counts_B[k] * counts_W[k]
    # print(counts[k])

print(total)

Buggy submission (verdict: Runtime Error):


def update(M, S, i, j, H, W, cluster):
    for i_n in [i - 1, i, i + 1]:
        for j_n in [j - 1, j, j + 1]:
            if i_n >= H or i_n < 0:
                continue
            if j_n >= W or j_n < 0:
                continue

            if i_n == i and j_n == j:
                continue
            if abs(i - i_n) + abs(j - j_n) == 2:
                continue

            if S[i][j] != S[i_n][j_n] and M[i_n][j_n] == 0:
                # print(M)
                M[i_n][j_n] = cluster
                update(M, S, i_n, j_n, H, W, cluster)


H, W = list(map(int, input().split()))
S = []
for i in range(H):
    S.append(input().strip())

cluster = 1
counts_B = {}
counts_W = {}
M = [[0 for j in range(W)] for i in range(H)]
for i in range(H):
    for j in range(W):
        if M[i][j] == 0:
            M[i][j] = cluster
            update(M, S, i, j, H, W, cluster)
            cluster = cluster + 1
        counts_B[M[i][j]] = 0
        counts_W[M[i][j]] = 0


for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            counts_B[M[i][j]] += 1
        else:
            counts_W[M[i][j]] += 1

    #     print(M[i][j], end=" ")
    # print("")

total = 0
for k in counts_B.keys():
    if k in counts_W:
        total += counts_B[k] * counts_W[k]
    # print(counts[k])

print(total)
Problem p02641 (python)

Fixed submission:
x, n = map(int, input().split())
p = list(map(int, input().split()))

w, cnt = 0, 0
while cnt < 201:
  if x + w not in p:
    print(x + w)
    break

  w += ((-1) ** cnt) * cnt
  cnt += 1

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

w, cnt = 0, 0
while True:
  w += ((-1) ** cnt) * cnt
  cnt += 1

  if x + w not in p:
  　print(x + w)
  	break
Problem p02658 (python)

Fixed submission:
def main():
	N = int(input())
	A = list(map(int, input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main()

Buggy submission (verdict: Runtime Error):
c = 10**18

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

for i in a:
    b *= i
    if b > c:
        print(-1)
        return

print(b)

Buggy submission (verdict: Runtime Error):
c = 10**18

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

if 0 in a:
    print(0)
    return

for i in a:
    b *= i

if b > c:
    print('-1')
else:
    print(b)
Problem p02681 (python)

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

adjusted_t = t[:-1]

if s==adjusted_t:
  print("Yes")
else:
  print("No")

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

adjusted_t = t[:-1]

if s==adjuested_t:
  print("Yes")
else:
  print("No")
Problem p02694 (python)

Fixed submission:
Target = int(input())
original = 100
i=1;
while(1):
 original = original + int(original*0.01)
 if(original >= Target):
   print(i)
   break;
 i=i+1;

Buggy submission (verdict: Runtime Error):
import math
Target = int(input())
original = 100
i=0;
while(1)
 i=i+1;
 original = int(original + original*0.01)
 if(original > target)
   print(i)
   break;
Problem p02741 (python)

Fixed submission:
number = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
N = int(input())
print(number[N-1])

Buggy submission (verdict: Runtime Error):
number = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
N = int(input())
print(number[N+1])

Buggy submission (verdict: Runtime Error):
number = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
N = int(input())
print(number[N])
Problem p02658 (python)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
if 0 in A:
  print(0)
  exit()
ans = 1
for i in range(len(A)):
  ans = ans * A[i]
  if ans > 10 ** 18:
    print(-1)
    exit()
  else:
    pass
  
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy
n = int(input())
A = map(int, input().split())
ans = numpy.prod(A)
if ans > 10 ** 8:
  print(-1)
else:
  print(ans)
Problem p02731 (python)

Fixed submission:
L = int(input())

print((L**3)/27)

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

print((L**3)/27)
Problem p02755 (python)

Fixed submission:
import math
a,b = map(int, input().split())
A = int(math.floor(a * (100/8)))
A1 = int(math.ceil((a+1)*(100/8)))
B = int(math.floor(b * (100/10)))
B1 = int(math.ceil((b+1) * (100/10)))
X = []
Y = []
for i in range(A,A1+1):
  if int(math.floor(i*(8/100))) == a:
    X.append(i)
  else:
    pass
  
for i in range(B,B1+1):
  if int(math.floor(i*(10/100))) == b:
    Y.append(i)
  else:
    pass
    
if set(X)&set(Y) == set():
  print(-1)
else:
  Z = list(set(X)&set(Y))
  Z.sort()
  print(Z[0])

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int, input().split())
A = int(math.floor(a * (100/8)))
B = int(math.floor(b * (100/10)))
X = []
while True:
  if int(math.floor(A*(8/100))) == a:
    X.append(A)
    break
  else:
    A += 1
 
while True:
  if int(math.floor(B*(8/100))) == b:
    X.append(B)
    break
  else:
    B += 1
    
if set(A)&set(B) == set():
  print(-1)
else:
  C = list(set(A)&set(B))
  C.sort()
  print(C[0])
Problem p02784 (python)

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

if sum(A) >= h:
  print("Yes")
else:
  print("No")

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

if H <= sum(A):
  print("Yes")
else:
  print("No")
Problem p02813 (python)

Fixed submission:
from itertools import permutations
n = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

A = list(permutations(P))
A.sort()
print(abs(A.index(tuple(P)) - A.index(tuple(Q))))

Buggy submission (verdict: Runtime Error):
from itertools import permutations
n = int(input())
P = list(map(int, input().split()))
Q = list(map, int(input().split()))

A = list(itertools.permutations(P))
A.sort()
print(abs(A.index(tuple(P)) - A.index(turple(Q))))
Problem p02946 (python)

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

a = max(-1000000,x - (k-1))
b = min(1000000,x+(k-1))

L = [str(i) for i in range(a,b+1)]
print(" ".join(L))

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

a = min(-1000000,x - (k-1))
b = max(1000000,x+(k-1))

L = [i for i in range(a,b+1)]
print(" ".join(L))

Buggy submission (verdict: Runtime Error):
k,x = map(int, input())

a = min(-1000000,x - (k-1))
b = max(1000000,x+(k-1))

L = [i for i in range(a,b+1)]
print(" ".join(L))
Problem p03211 (python)

Fixed submission:
s = list(input())

ans = []
for i in range(0,len(s)-2):
  d = int("".join(s[i]+s[i+1]+s[i+2]))
  ans.append(abs(d-753))
  
print(min(ans))

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

ans = []
for i in range(0,len(s)-2):
  d = int("".join(s[i]+s[i+1]+s[i+2]))
  ans.append(abs(b-753))
  
print(min(ans))
Problem p03243 (python)

Fixed submission:
n =  list(input())
N = [int(n[i]) for i in range(len(n))]
if N[0] == max(N):
  print(max(N) * 100 + max(N)*10 + max(N))
else:
  m = N[0]+1
  print(m * 100 + m * 10 + m)

Buggy submission (verdict: Runtime Error):
n =  list(input())
N = [int(n[i]) for i in range(len(n))]
if N[0] == max(N):
  print(max(N) * 100 + max(N)*10 + max(N))
else:
  m = N+1
  print(m * 100 + m * 10 + m)
Problem p03244 (python)

Fixed submission:
from collections import Counter
n = int(input())
V = list(map(int,input().split()))
A = Counter(V[0::2]).most_common(2)
B = Counter(V[1::2]).most_common(2)
A.append((0,0))
B.append((0,0))
if A[0][0]!=B[0][0]:
    print(n-(A[0][1]+B[0][1]))
else:
    print(min(n-(A[1][1]+B[0][1]),n-(A[0][1]+B[1][1])))

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
V = list(map(int,input().split()))
A = Counter(V[0::2]).most_common(2)
A = Counter(V[1::2]).most_common(2)
A.append((0,0))
A.append((0,0))
if A[0][0]!=B[0][0]:
    print(n-(A[0][1]+B[0][1]))
else:
    print(min(n-(A[1][1]+B[0][1]),n-(A[0][1]+B[1][1])))
Problem p03251 (python)

Fixed submission:
n,m,x,y = map(int, input().split())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))

if min(Y) <= max(X):
  print("War")
  exit()
else:
  for i in range(max(X)+1, min(Y)+1):
    if x < i <= y:
      print("No War")
      exit()
      
print("War")

Buggy submission (verdict: Runtime Error):
n,m,x,y = map(int, input().split())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))

if if min(Y) <= max(X):
  print("War")
  exit()
else:
  for i in range(max(X)+1, min(Y)+1):
    if x < i <= y:
      print("No War")
      exit()
      
print("War")
Problem p03289 (python)

Fixed submission:
s = input()
n = len(s)
if s[0] == "A" and s[2:n-1].count("C") == 1 and len(set(s.upper()) & set(s)) == 2:
  print("AC")
else:
  print("WA")

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

if s[0] != "A" or (s[2] != "C" and s[-1] != "C"):
  print("WA")
elif s[0] == "A" and s[2] == "C":
  s = list(s)
  s.pop(0)
  s.pop(1)
  for i in s:
    if s[i] != s[i].lower():
      print("WA")
      exit()
elif s[0] == "A" and s[-1] == "C":
  s = list(s)
  s.pop(0)
  s.pop(-1)
  for i in s:
    if s[i] != s[i].lower():
      print("WA")
      exit()
      
print("AC")
Problem p03292 (python)

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

print(abs(max(a,b,c) - min(a,b,c)))

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

L = [a,b,c]
L.sorted()

print(abs(L[2]-L[0]))
Problem p03308 (python)

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

ANS = []
for i in range(len(A)):
  for j in range(i,len(A)):
    ANS.append(abs(A[i] - A[j]))
    
print(max(ANS))

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

ANS = []
for i in range(len(A)):
  for j in range(i,len(A)+1):
    ANS.append(abs(A[i] - A[j]))
    
print(max(ANS))
Problem p03352 (python)

Fixed submission:
import math
x = int(input())

L = []
for i in range(2,int(math.floor(math.sqrt(x)))+1):
  for j in range(x//i + 1):
    if i ** j <= x:
      L.append(i ** j)
      
if L == []:
  print("1")
else:
  print(max(L))

Buggy submission (verdict: Runtime Error):
import math
x = int(input())

L = []
for i in range(2,int(math.floor(math.sqrt(x)))+1):
  for j in range(x//i + 1):
    if i ** j <= x:
      L.append(i ** j)
      
print(max(L))

Buggy submission (verdict: Runtime Error):
import math
x = int(input())

L = []
for i in (2,int(math.floor(math.sqrt(x)))+1):
  for j in (range(x//i)):
    if i ** j <= x:
      L.append(i**j)
      
print(max(L))
Problem p03556 (python)

Fixed submission:
import math
n = int(input())
m = math.sqrt(n)
x = int(math.floor(m))
print(x**2)

Buggy submission (verdict: Runtime Error):
n = import math
m = math.sqrt(n)
print(math.floor(m))
Problem p03573 (python)

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

if a==b:
  print(c)
elif a==c:
  print(b)
elif b==c:
  print(a)

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

if a==b:
  print(c)
elif a==c:
  print(b)
else b==c:
  print(a)
Problem p03609 (python)

Fixed submission:
x,t = map(int, input().split())
 
if x >= t:
  print(x-t)
else:
  print("0")

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

if x => t:
  print(x-t)
else:
  print("0")
Problem p03632 (python)

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

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

if b < c or d < a:
  print("0")
elif a <= c:
  if b <= d:
    print(b-c)
  else:
    print(d-c)
else:
  if c <= a:
    print(d-a)
  else:
    print(d-c)
Problem p03672 (python)

Fixed submission:
s = input()[:-1]

length = len(s)

for a in range(length, 1, -1):
  temp = s[:a]
  if len(temp) %2 == 0:
    half = len(temp)//2
    if temp[:half] == temp[half:]:
      ans = len(temp)
      break #ここでbreakするために，forを大きいところから回してる
    
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()[:-1]

length = len(s)

for a in range(length, 1, -1):
  temp = s[:a]
  if len(temp) %2 == 0:
    half = len(temp)//2
    if temp[:half] == temp[half:]:
      ans = len(temp)
    break #ここでbreakするために，forを"大きいところ"から回してる
    
print(ans)
Problem p03693 (python)

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

if (10*g + b) %4 == 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
r,g,b = map(int , input()split())

if (10*g + b) %4 == 0:
  print("YES")
else:
  print("NO")
Problem p03697 (python)

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

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

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

if a+b < 10:
  print(a+b)
else :
  print("error")
Problem p03730 (python)

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

for i in range(1,b+1):
  if (a*i)%b == c:
    print("YES")
    exit()
    
print("NO")

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

x = a % b
y = c % b

if y % x == 0:
  print("YES")
else :
  print("NO")

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

x = b % b
y = c % b

if y % x == 0:
  print("YES")
else :
  print("NO")

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

x = A % B
y = C % B

if y % x == 0:
  print("YES")
else :
  print("NO")
Problem p03760 (python)

Fixed submission:
O = input()
E = input()

L = []
for i in range(len(O)):
  L.append(O[i])
  L.append("")

for j in range(len(E)):
  L[2*j+1] = E[j]

l = ""
for i in range(len(L)):
  l = l + L[i]

print(l)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()

l = min(len(O), len(E))
s = ""
for i in range(l):
  s = s + O[i] + E[i]

if len(O) > len(E):
  s = s + O[len(O)]

print(s)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()

l = min(len(O), len(E))
s = ""
for i in range(l):
  s = s + O[i] + E[i]

if len(0) > len(E):
  s = s + O[len(O)]

print(s)
Problem p03998 (python)

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

A = list(input())
B = list(input())
C = list(input())
X = [A,B,C]
t = 0

while True:
  if X[t] == []:
    if t == 0:
      print("A")
      break
    elif t == 1 :
      print("B")
      break
    elif t == 2:
      print("C")
      break
  else:
    if X[t][0] == "a":
      X[t].remove(X[t][0])
      t = 0
    elif X[t][0] == "b":
      X[t].remove(X[t][0])
      t = 1
    elif X[t][0] == "c":
      X[t].remove(X[t][0])
      t = 2

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

A = list(input())
B = list(input())
C = list(input())

X = [A,B,C]

x = 0
while True :
  if X[x][0] == "a":
    if X[0] == []:
      print("A")
      break
    else:
      X[0].remove(X[0][0])
      x = 0
  elif X[x][0] == "b":
    if X[1] == []:
      print("B")
      break
    else:
      X[1].remove(X[1][0])
      x = 1
  elif X[x][0] == "c":
    if X[2] == []:
      print("C")
      break
    else:
      X[2].remove(X[2][0])
      x = 2

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

A = list(input())
B = list(input())
C = list(input())

X = [A,B,C]

x = 0
while True :
  if X[x][0] == "a":
    if X[0] == []:
      print("A")
      break
    else:
      X[0].remove(X[0][0])
      x == 0
    
  elif X[x][0] == "b":
    if X[1] == []:
      print("B")
      break
    else:
      X[1].remove(X[1][0])
      x == 1
    
  elif X[x][0] == "c":
    if X[2] == []:
      print("C")
      break
    else:
      X[2].remove(X[2][0])
      x == 2
Problem p04030 (python)

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

S = str(input())

w = ""

for i in range(len(S)) :
  if S[i] == "B" :
    if w == "":
      w = ""
    else :
      w = w[:-1]
  else :
    w = w + S[i]
    
print(w)

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

S = str(input())

w = ""
for i in range(len(S)):
  if S[i] = "B":
    if w == "":
      w = ""
    else :
      w = w.rstrip()
  else:
    w + S[i]

print(w)

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

S = str(input())

w = ""
for i in range(len(S)):
  if S[i] = "B":
    if w != "":
      w = ""
    else :
      w = w.rstrip()
  else:
    w + S[i]

print(w)

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

S = str(input())

w = ""
for i in range(len(S)):
  if S[i] = "B":
    if w == "":
      w = ""
    else :
      w.remove(w[-1])
  else:
    w + S[i]

print(w)

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

S = str(input())

w = ""
for i in range(len(S)):
  if S[i] = "B":
    if w != "":
      w = ""
    else :
      w.remove(w[-1])
  else:
    w + S[i]

print(w)
Problem p04044 (python)

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

n,l = map(int, input().split())

L = list([input() for i in range(n)])
L.sort()
word = ""

for i in range(len(L)):
  word = word + L[i]

print(word)

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

n,l = map(int, input().split())

L = list([input() for i in range(n)])
L.sort()
word = ""

for i in len(L):
  word = word + L[i]

print(word)

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

n,l = map(int, input().split())

L = list(map(int, [input() for i in range(n)]))
L.sort()
word = ""

for i in len(L):
  word = word + L[i]

print(word)

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

n,l = map(int, input().split())

L = map(int, [input() for i in range(n)])
L.sort()
word = ""

for i in len(L):
  word = word + L[i]

print(word)

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

n,l = map(int, input().split())

L = map(int, [input() for i in range(n)])

word = ""
for i in len(L):
  L.sort()
  word = word + L[0]
  L = L.remove(L[0])

print(word)
Problem p02664 (python)

Fixed submission:
s = str(input())

nw1 = s.replace("?","D")

print(nw1)

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

nw = []
i = 0

for i in range(0,len(s),1):
  if s[i] == '?' and s[i-1] == 'P':
    nw.append('D')
  elif s[i] == '?' and s[i-1] == 'D':
    nw.append('D')
  elif s[i] == '?' and s[i-1] == '?':
    if nw[-1] == 'P':
      nw.append('D')
    elif nw[-1] == 'D':
      nw.append('D')
    
  else:
    nw.append(s[i])

print(''.join(nw))
Problem p02677 (python)

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

import math
#得られる三角形の中心の角度を求める
M_rad = (2*math.pi/60)*M
H_rad = (2*math.pi/12)*(H + 1/60*M)
rad = abs(H_rad - M_rad)

#三角形が成立する条件
#長針と短針が被ったとき
if math.degrees(M_rad)-0.1 < math.degrees(H_rad) < math.degrees(M_rad)+0.1:
  print(abs(A-B))
  exit()
#長針と短針が180度の時
elif 180-0.1 < math.degrees(rad) < 180+0.1:
  print(abs(A+B))
  exit()
else:
  #二項定理
  C = math.sqrt(abs(A*A + B*B - 2*A*B*math.cos(rad)))
  print(abs(C))

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

import math
#得られる三角形の中心の角度を求める

H_rad = 2*math.pi()/12*H
M_rad = 2*math.pi()/60*M
rad = abs(H_rad - M_rad)

#二項定理
C = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(rad))
print(C)
Problem p03284 (python)

Fixed submission:
N, K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
if N % K == :
  print(0)
else:
  print(1)
Problem p02690 (python)

Fixed submission:
def main():
    x = int(input())

    _n = int(x ** .2)
    for n in range(_n-2, _n+3):
        if n ** 5 == x:
            print(n, 0)
            return
    
    for i in range(1, 100):
        if x - i ** 5 < 0:
            continue
        _n = int((x - i ** 5) ** .2)
        for n in range(_n-2, _n+3):
            if n ** 5 == (x - i ** 5):
                print(i, -n)
                return
    
    for i in range(1, 1000):
        fif = x + i ** 5
        _n = int(fif ** .2)
        for n in range(_n-2, _n+3):
            if n ** 5 == fif:
                print(n, i)
                return

main()

Buggy submission (verdict: Runtime Error):
def main():
    x = int(input())

    n = int(x ** .2)
    if n ** 5 == x:
        print(n, 0)
        return
    
    for i in range(1, 100):
        n = int((x - i ** 5) ** .2)
        if n ** 5 == (x - i ** 5):
            print(i, -n)
            return
    
    for i in range(1, 10000):
        fif = x + i ** 5
        n = int(fif ** .2)
        if n ** 5 == fif:
            print(fif, i)
            return

main()

Buggy submission (verdict: Runtime Error):
def main():
    x = int(input())

    if (n := int(x ** .2)) ** 5 == x:
        print(n, 0)
        return
    
    for i in range(1, 10000):
        if (n := int((x - i ** 5) ** .2)) ** 5 == (x - i ** 5):
            print(i, -n)
            return
    
    v = (x / 5)

    for i in range(1, 10000):
        fif = x + i ** 5
        if (n := int(fif ** .2)) ** 5 == fif:
            print(fif, i)
            return

main()

Buggy submission (verdict: Runtime Error):
def main():
    x = int(input())

    if (n := int(x ** .2)) ** 5 == x:
        print(n, 0)
        return
    
    for i in range(1, 10000):
        if (n := int((x - i ** 5) ** .2)) ** 5 == (x - i ** 5):
            print(i, -n)
            return
    
    v = (x / 5)

    for i in range(1, 10000):
        fif = x + i ** 5
        if (n := int(fif ** .2)) ** 5 == fif:
            print(fif, i)
            return

main()
Problem p02727 (python)

Fixed submission:
x, y, a, b, c = map(int, input().split())
ps = list(map(int, input().split()))
qs = list(map(int, input().split()))
rs = list(map(int, input().split()))
ps.sort()
ps = ps[-x:]
qs.sort()
qs = qs[-y:]
pqs = ps + qs
pqs.sort()
rs.sort(reverse=True)

answer = sum(pqs)
for i in range(min(x+y, c)):
    diff = rs[i] - pqs[i]
    if diff < 0:
        break
    answer += diff

print(answer)

Buggy submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
ps = list(map(int, input().split()))
qs = list(map(int, input().split()))
rs = list(map(int, input().split()))
ps.sort()
ps = ps[-x:]
qs.sort()
qs = qs[-y:]
pqs = ps + qs
pqs.sort()
rs.sort(reverse=True)

answer = sum(pqs)
for i in range(c):
    diff = rs[i] - pqs[i]
    if diff < 0:
        break
    answer += diff

print(answer)