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

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

#%%

ACs = [False for _ in range(N)]
WAs = [0 for _ in range(N)]

for pS in pSs:
    problem = int(pS[0]) -1
    answer = pS[1]
    if ACs[problem] == True:
        continue
    else:
        if answer == "WA":
            WAs[problem] += 1
        else:
            ACs[problem] = True

num_WA = 0
for i, WA in enumerate(WAs):
    if ACs[i] == True:
        num_WA += WA

print(sum(ACs), num_WA)

Buggy submission (verdict: Runtime Error):


N, M = map(int,input().split())
A = [list(map(str,input().split())) for _ in range(M)]
A = sorted(A, key=lambda x: x[0])

all_failure = 0
all_AC = 0
scan = 0
for j in range(N):
    while M <= scan:
        #print(j,i,int(A[scan][0]), A[scan][1])
        if int(A[scan][0]) == j+1 and A[scan][1] == "WA":
            all_failure += 1
            scan+=1
        elif int(A[scan][0]) == j+1 and A[scan][1] ==  "AC":
            all_AC+=1
            scan+=1
            break
        elif int(A[scan][0]) < j:
            scan += 1
        else:
            break
        
print(all_AC, all_failure)

Buggy submission (verdict: Runtime Error):
all_failure = 0
all_AC = 0
scan = 0
for j in range(N):
    while M < scan:
        #print(j,i,int(A[scan][0]), A[scan][1])
        if int(A[scan][0]) == j+1 and A[scan][1] == "WA":
            all_failure += 1
            scan+=1
        elif int(A[scan][0]) == j+1 and A[scan][1] ==  "AC":
            all_AC+=1
            scan+=1
            break
        elif int(A[scan][0]) < j:
            scan += 1
        else:
            break
        
print(all_AC, all_failure)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = [list(map(str,input().split())) for _ in range(M)]
#A = sorted(A, key=lambda x: x[0])

all_failure = 0
all_AC = 0
scan = 0
for j in range(N):
    while scan <= M:
        if int(A[scan][0]) == j+1 and A[scan][1] == "WA":
            all_failure += 1
            scan+=1

        elif int(A[scan][0]) == j+1 and A[scan][1] ==  "AC":
            all_AC+=1
            scan+=1
            break
        else:
            break
        
print(all_AC, all_failure)

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = [list(map(str,input().split())) for _ in range(M)]
A = sorted(A, key=lambda x: x[0])

all_failure = 0
all_AC = 0
scan = 0
for j in range(N):
    while scan <= M:
        if int(A[scan][0]) == j+1 and A[scan][1] == "WA":
            all_failure += 1
            scan+=1

        elif int(A[scan][0]) == j+1 and A[scan][1] ==  "AC":
            all_AC+=1
            scan+=1
            break
        else:
            break
        
print(all_AC, all_failure)
Problem p02900 (python)

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

saidai_kouyaku = gcd(A,B)

#%%
kouyaku = [0 for _ in range(int(saidai_kouyaku**0.5)+2)]
kouyaku[1] = 1


for i in range(2,len(kouyaku)):
    while saidai_kouyaku%i==0:
        kouyaku[i]+=1
        saidai_kouyaku = saidai_kouyaku/i

answer = 0
for i in range(len(kouyaku)):
    if kouyaku[i] > 0:
        answer += 1

if saidai_kouyaku > 1:
    print(answer+1)
else:
    print(answer)

Buggy submission (verdict: Runtime Error):
from math import gcd
A, B = map(int, input().split())
max_range = int(max(A, B)**0.5)

kouyaku = [0 for _ in range(max_range+1)]
kouyaku[1] = 1


saidai_kouyaku = gcd(A,B)
print(saidai_kouyaku)
for i in range(2,max_range):
    while saidai_kouyaku%i==0:
        kouyaku[i]+=1
        saidai_kouyaku = saidai_kouyaku/i
sum_num = sum(kouyaku)
answer = 0

for i in range(len(kouyaku)):
    if kouyaku[i] > 0:
        answer += 1
print(answer)
Problem p02901 (python)

Fixed submission:

n, m = map(int, input().split())
ab = []
c= []
keys = ["" for _ in range(m)]

for i in range(m):
    ab.append(list(map(int, input().split())))
    kari = list(map(int, input().split()))
    c.append(kari)
    for j in range(n):
        if j+1 in kari:
            keys[i] = keys[i]+"1"
        else:
            keys[i] = keys[i] + "0"

all_patterns = ["0","1"]
options = ["0", "1"]

for _ in range(n-1):
    all_patterns = [j+i for i in (options) for j in all_patterns]

dp = [1e+10 for i in range(2**n)]
dp[0] = 0

#%%
for j in range(m):
    for i in range(len(dp)):
        kari1 = dp[i]+ab[j][0]
        kari2 = dp[i|int(keys[j],2)]
        if kari1 < kari2:
            dp[i|int(keys[j],2)] = kari1

if dp[-1] != 1e+10:
    print(dp[-1])
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
f = open("C:/Users/naoki/Desktop/Atcoder/input.txt")
n, m = map(int, f.readline().split())
ab = []
c= []
keys = ["" for _ in range(m)]

for i in range(m):
    ab.append(list(map(int, f.readline().split())))
    kari = list(map(int, f.readline().split()))
    c.append(kari)
    for j in range(n):
        if j+1 in kari:
            keys[i] = keys[i]+"1"
        else:
            keys[i] = keys[i] + "0"

all_patterns = ["0","1"]
options = ["0", "1"]

for _ in range(n-1):
    all_patterns = [j+i for i in (options) for j in all_patterns]

dp_dict = dict()
for pattern in all_patterns:
    dp_dict[pattern] = 1e+10
dp_dict["0"*n] = 0

for j in range(m):
    for key in dp_dict.keys():
        kari1 = dp_dict[key]+ab[j][0]
        kari2 = dp_dict[format(int(key,2)|int(keys[j],2),"0"+str(n)+"b")]
        if kari1 < kari2:
            dp_dict[format(int(key,2)|int(keys[j],2),"0"+str(n)+"b")] = kari1

if dp_dict["1"*n] != 1e+10:
    print(dp_dict["1"*n])
else:
    print(-1)
Problem p03716 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun May  3 18:58:46 2020

@author: naoki
"""
from heapq import heappush, heappop
import sys

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

hq = []
hq_r = []
for i in range(N):
    heappush(hq,a[i])
    heappush(hq_r,-1*a[-1-i])


max_A = [0 for _ in range(N+1)]
max_A[0] = sum(hq)

min_C = [0 for _ in range(N+1)]
min_C[0] = sum(hq_r) * (-1)

for i in range(N):
    heappush(hq, a[N+i])
    heappush(hq_r, -1*a[-N-1-i])
    minus = heappop(hq)
    minus_r = heappop(hq_r)
    max_A[i+1] = max_A[i] + a[N+i] - minus
    min_C[i+1] = min_C[i] + a[-N-1-i] + minus_r
    
max_val = -10e+100
for i in range(N+1):
    kari = max_A[i] - min_C[-1-i]
    if max_val < kari:
        max_val =kari
print(max_val)

Buggy submission (verdict: Runtime Error):


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

A = (a[0:N])
A = deque(sorted(A))
B = deque(a[N:2*N])
C = a[2*N:3*N]
C = deque(sorted(C, reverse = True))

original_score = 0
for i in range(N):
    original_score += A[i] - C[i]

left = 0
right = 0

for i in range(N):
    left_candidate = B[left] - A[left]
    right_candidate = C[right] - B[-1-right]
    
    if left_candidate >= right_candidate:
        left+=1
        original_score+=left_candidate
    else:
        right+=1
        original_score+=right_candidate
print(original_score)
Problem p02613 (python)

Fixed submission:
import collections

n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s)

print('AC x ', c['AC'])
print('WA x ', c['WA'])
print('TLE x ', c['TLE'])
print('RE x ', c['RE'])

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s)

print('AC x ', c['AC'])
print('WA x ', c['WA'])
print('TLE x ', c['TLE'])
print('RE x ', c['RE'])
Problem p02993 (python)

Fixed submission:
s = list(input())

p = ''
for i in s:
    if p == i:
        print('Bad')
        exit()
    else:
        p = i
print('Good')

Buggy submission (verdict: Runtime Error):
import fractions

a, b, c, d = map(int, input().split())

b_c = b//c - (a-1)//c
d_c = b//d - (a-1)//d
cd = (c * d) // fractions.gcd(c, d)
cd_c = b//cd - (a-1)//cd

print((b - a + 1) - (b_c + d_c - cd_c))

Buggy submission (verdict: Runtime Error):
import fractions

a, b, c, d = map(int, input().split())

b_c = b//c - (a-1)//c
d_c = b//d - (a-1)//d
cd = (c * d) // math.gcd(c, d)
cd_c = b//cd - (a-1)//cd

print((b - a + 1) - (b_c + d_c - cd_c))
Problem p02995 (python)

Fixed submission:
import fractions

a, b, c, d = map(int, input().split())

b_c = b//c - (a-1)//c
d_c = b//d - (a-1)//d
cd = (c * d) // fractions.gcd(c, d)
cd_c = b//cd - (a-1)//cd

print((b - a + 1) - (b_c + d_c - cd_c))

Buggy submission (verdict: Runtime Error):
import math

a, b, c, d = map(int, input().split())

b_c = b//c - (a-1)//c
d_c = b//d - (a-1)//d
cd = (c * d) // math.gcd(c, d)
cd_c = b//cd - (a-1)//cd

print((b - a + 1) - (b_c + d_c - cd_c))
Problem p03105 (python)

Fixed submission:
A,B,C=map(int,input().split())
D=B//A-C
if D>0:
  print(C)
else:
  print(B//A)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
D=B//A-C
if D>0:
  print(C)
else:
  print(B//A)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
while A<1 or A>100 or B<1 or B>100 or C<1 or C>100:
	A=int(input())
    B=int(input())
    C=int(input())
D=B//A-C
if D>0:
  print(C)
else:
  print(B//A)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
while A<1 or A>100 or B<1 or B>100 or C<1 or C>100:
	A=int(input())
    B=int(input())
    C=int(input())
D=B//A-C
if D>0:
  print(C)
else:
  print(B//A)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
C=int(input())
while A<1 or A>100 or B<1 or B>100 or C<1 or C>100:
 A=int(input()),B=int(put()),C=int(input())
D=B//A-C
if D>0:
  print(C)
else:
  print(B//A)

Buggy submission (verdict: Runtime Error):
A=int(input()),B=int(put()),C=int(input())
while A<1 or A>100 or B<1 or B>100 or C<1 or C>100:
 A=int(input()),B=int(put()),C=int(input())
D=B//A-C
if D>0:
  print(C)
else:
  print(B//A)
Problem p03106 (python)

Fixed submission:
A,B,K=map(int,input().split())
i=0
j=1
a=[]
while j<=max(A,B):
    if A%j==0 and B%j==0:
        a.append(j)
    j+=1
print(a[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
i=0
j=1
a=[]
while A%j==0 and B%j==0:
    a.append(j)
    j+=1
print(a[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
i=0
j=1
a=[]
if A%j==0 and B%j==0:
    a.append(j)
    j+=1
print(a[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
i=0
j=1
a=[]
if A%j==0 and B%j==0:
    a.append(j)
    j+=1
print(a[-4])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
i=1
j=2
if A%j=0 and B%j=0 and i<K:
  i+=1
  j+=1
print(j)
Problem p03111 (python)

Fixed submission:
N,A,B,C=map(int,input().split())
l=[int(input()) for i in range(N)]
inf=10**9
def dfs(d,a,b,c):
    if d==N:#合成完了
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf #無からは作れない#0に合成するのにmpは使わないので-30
    ret0=dfs(d+1,a,b,c)#l[d]を使わない
    ret1=dfs(d+1,a+l[d],b,c)+10#l[d]をAに
    ret2=dfs(d+1,a,b+l[d],c)+10#l[d]をBに
    ret3=dfs(d+1,a,b,c+l[d])+10#l[d]をCに
    ans=min(ret0,ret1,ret2,ret3)
    return ans
print(dfs(0,0,0,0))

Buggy submission (verdict: Runtime Error):
N,A,B,C=map(int,input().split())
l=[int(input()) for i in range(N)]
inf=10**9
def dfs(d,a,b,c):
    if d==n:#合成完了
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf #無からは作れない#0に合成するのにmpは使わないので-30
    ret0=dfs(d+1,a,b,c)#l[d]を使わない
    ret1=dfs(d+1,a+l[d],b,c)+10#l[d]をAに
    ret2=dfs(d+1,a,b+l[d],c)+10#l[d]をBに
    ret3=dfs(d+1,a,b,c+l[d])+10#l[d]をCに
    return min(ret0,ret1,ret2,ret3)
print(dfs(0,0,0,0))

Buggy submission (verdict: Runtime Error):
N,A,B,C=map(int,input().split())
l=[int(input()) for i in range(N)]
inf=10**9
def dfs(d,a,b,c):
    if d==n:#合成完了
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf #無からは作れない
    ret0=dfs(d+1,a,b,c)#l[d]を使わない
    ret1=dfs(d+1,a+l[d],b,c)+10#l[d]をAに
    ret2=dfs(d+1,a,b+l[d],c)+10#l[d]をBに
    ret3=dfs(d+1,a,b,c+l[d])+10#l[d]をCに
    return min(ret0,ret1,ret2,ret3)
print(dfs(0,0,0,0))

Buggy submission (verdict: Runtime Error):
N,A,B,C=map(int,input().split())
l=[int(input()) for i in range(N)]
inf=10**9
def dfs(d,a,b,c):
    if d==n:#合成完了
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf
    ret0=def(d+1,a,b,c)#l[d]を使わない
    ret1=def(d+1,a+l[d],b,c)+10#l[d]をAに
    ret2=def(d+1,a,b+l[d],c)+10#l[d]をBに
    ret3=def(d+1,a,b,c+l[d])+10#l[d]をCに
    return min(ret0,ret1,ret2,ret3)
print(def(0,0,0,0))
Problem p03145 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(int(a*b/2))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(int(a*b/2)
Problem p03211 (python)

Fixed submission:
S=list(map(int,input()))
m=[]
for i in range(len(S)-2):
    m.append(abs(753-(100*S[i]+10*S[i+1]+S[i+2])))
print(min(m))

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

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

print(dfs('0'))
Problem p03238 (python)

Fixed submission:
N=int(input())
if N==1:
    print('Hello World')
else:
    A=int(input())
    B=int(input())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N==1:
    print('Hello World')
else:
    A,B=map(int,input().split())
    print(A+B)
Problem p03282 (python)

Fixed submission:
S=input()
K=int(input())
if S[0]!='1':
    print(S[0])
else:
    flag=True
    for i in range(len(S)):
        if S[i]!='1':
            if K<=i:
                print('1')
            else:
                print(S[i])
            flag=False
            break
    if flag:
        print(1)

Buggy submission (verdict: Runtime Error):
S=input()
K=int(input())
if S[0]!='1':
    print(S[0])
else:
    for i in range(len(S)):
        if S[i]!='1':
            if K<=i:
                print('1'):
            else:
                print(S[i])
            break
Problem p03030 (python)

Fixed submission:
n = int(input())
sp = [list(input().split()) for _ in range(n)]
for i in range(len(sp)):
    sp[i][1] = int(sp[i][1])
d = sorted(sp, key=lambda x:(x[0],-x[1]))
for i in range(len(sp)):
    print(sp.index(d[i])+1)

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

d = sorted(sp, key=lambda x:(x[0],-x[1]))
for i in range(len(sp)):
    print(sp.index(d[i]))

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

sorted(sp, key=lambda x:(x[0],-x[1]))
for i in range(len(sp)):
    print(sp[i])
Problem p03071 (python)

Fixed submission:
a, b = map(int, input().split())
 
def Buttons(x, y):
  if x > y:
    return 2*x-1
  elif x < y:
    return 2*y-1
  else:
    return x+y
 
 
print(Buttons(a,b))

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

def Buttons(x, y):
  if x > y:
    return 2x+1
  elif x < y:
    return 2y+1
  elif x==y:
    return x+y


Buttons(a,b)

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

def Bottuns(x, y):
  if x > y:
    return 2x+1
  elif x < y:
    return 2y+1
  elif x==y:
    return x+y


Buttons(a,b)
Problem p03085 (python)

Fixed submission:
b = input()
 
if b =="A":
  print("T")
elif b=="T":
  print("A")
elif b=="C":
  print("G")
else:
  print("C")

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

if b="A":
  print("T")
elif b="T":
  print("A")
elif b="C":
  print("G")
else:
  print("C")
Problem p03086 (python)

Fixed submission:
s = list(input())

L = []
cnt = 0

for x in s:
    if x == "A" or x == "C" or x == "G" or x == "T":
        cnt += 1
    else:
        L.append(cnt)
        cnt = 0
L.append(cnt)

print(max(L))

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

L = []
cnt = 0

for x in s:
    if x == "A" or x == "C" or x == "G" or x == "T":
        cnt += 1
    else:
        L.append(cnt)
        
max(L)
Problem p03087 (python)

Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0]*(N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)
for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
t = []*(N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
Problem p03103 (python)

Fixed submission:
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(N)]
AB.sort(key = lambda x: x[0])

total = 0
i = 0

while True:
    total += AB[i][1]
    if total < M:
        i += 1
    else:
        break

ans = 0
for j in range(i):
    ans += AB[j][0]*AB[j][1]
ans += (M - sum(AB[p][1] for p in range(0,i))) * AB[i][0]
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(N)]
AB.sort(key = lambda x: x[0])

total = 0
i = 0

while True:
    total += AB[i][1]
    if total < m:
        i += 1
    else:
        break

ans = 0
for j in range(i):
    ans += AB[j][0]*AB[j][1]
ans += (m - sum(AB[p][1] for p in range(0,i))) * AB[i][0]
Problem p03106 (python)

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

List = [x for x in range(min(A,B),0,-1) if A%x ==0 and B%x ==0]
print(List[K-1])

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

List = [x for x in range(min(A,B),1,-1) if A%x ==0 and B%x ==0]
print(List[K-1])

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

List = [x for x in range(max(A,B),1,-1) if A%x ==0 and B%x ==0]
print(List[K-1])
Problem p03246 (python)

Fixed submission:
from collections import Counter

n = int(input())
v = list(map(int, input().split()))

# Return the list of 2 most common numbers and each appearance
e = Counter(v[::2]);e[0] = 0
o = Counter(v[1::2]);o[0] = 0

e1,e2 = e.most_common(2)
o1,o2 = o.most_common(2)

if e1[0] != o1[0]:
    print(n - (e1[1] + o1[1]))
else:
    print(n - max(e1[1]+o2[1],e2[1]+o1[1]))

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

n = int(input())
v = list(map(int, input().split()))

e = Counter(v[::2]).most_common(2)
o = Counter(v[1::2]).most_common(2)

if e[0][0] != o[0][0]:
    print(n - (e[0][1] + o[0][1]))
else:
    print(n - max(e[0][1]+o[1][1],e[1][1]+o[0][1]))
Problem p02534 (python)

Fixed submission:
print("ACL"*int(input()))

Buggy submission (verdict: Runtime Error):
print("ACL"*int(input))
Problem p02536 (python)

Fixed submission:

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

# cities = [[0] * N for i in range(N)]
# print(cities)
cities = {}
 
for a in range(N):
    cities[a+1] = []
# print(cities)
 
for i in range(M):
    i1, i2 = map(int, input().split())
    cities[i1].append(i2)
    cities[i2].append(i1)
# print(cities)
def connected_components(graph):
    seen = set()
    def component(n):
        nodes = set([n])
        while nodes:
            n = nodes.pop()
            seen.add(n)
            nodes |= set(graph[n]) - seen
            yield n
    for n in graph:
        if n not in seen:
            yield component(n)
print(len([list(x) for x in connected_components(cities)])-1)

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

from scipy.sparse.csgraph import connected_components

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

cities = np.zeros((N, N))

for i in range(M):
    i1, i2 = map(int, input().split())
    cities[i1-1][i2-1] = 1
    cities[i2-1][i1-1] = 1
#     print(cities)
    
# print(cities)

n, lasbel = connected_components(cities)
print(n-1)
Problem p02657 (python)

Fixed submission:
Line = [int(s) for s in input().split()]

print(Line[0]*Line[1])

Buggy submission (verdict: Runtime Error):
Line = [int(s) for s in input().split()]

print(Liine[0]*Line[1])
Problem p02677 (python)

Fixed submission:
import math

Line = [int(s) for s in input().split()]

A,B,H,M = Line[0],Line[1],Line[2],Line[3]

# print(A,B,H,M)

kakudo = abs(  H/12*360 + M/12/60*360 - M/60*360 )

if kakudo > 180 :
    kakudo = 360 - kakudo

# print(kakudo)

ans = math.sqrt(A**2 + B**2 - 2*A*B*round(math.cos(math.radians(kakudo)),100))

print(ans)

Buggy submission (verdict: Runtime Error):
import math

Line = [int(s) for s in input().split()]

A,B,H,M = Line[0],Line[1],Line[2],Line[3]

# print(A,B,H,M)

kakudo = abs(  H/12*360 + M/12/60*360 - M/60*360 )

if kakudo > 180 :
    kakudo = 360 - kakudo

# print(kakudo)

ans = math.sqrt(A**2 + B**2 - 2*A*B*round(math.cos(round(math.radians(kakudo),100),100))

print(ans)
Problem p02690 (python)

Fixed submission:
import itertools
import math
import sys

X = list(range(-200,201))

X_list = list(map(lambda x: x ** 5, X))

# print(X_list)

ans = int(input())

# print(X_list[0])
# print(math.sqrt(X_list[200]))
for x in itertools.combinations(X_list, 2):
  if x[0]-x[1] == ans:
      a =abs(x[0]**(1/5))
      b =abs(x[1]**(1/5))
      if x[0] < 0:
          a = a*(-1)
      if x[1] < 0:
          b = b*(-1)
    #   print(x[0],x[1])
      print(int(a),int(b))
      sys.exit()
  if x[1]-x[0] == ans:
      a = abs(x[1]**(1/5))
      b = abs(x[0]**(1/5))
      if x[1] < 0:
          a = a*(-1)
      if x[0] < 0:
          b = b*(-1)
    #   print(x[1],x[0])
      print(int(a),int(b))
      sys.exit()

Buggy submission (verdict: Runtime Error):
for x in itertools.combinations(X_list, 2):
  if x[0]-x[1] == ans:
      a =abs(x[0]**(1/5))
      b =abs(x[1]**(1/5))
      if x[0] < 0:
          a = a*(-1)
      if x[1] < 0:
          b = b*(-1)
    #   print(x[0],x[1])
      print(int(a),int(b))
      sys.exit()
  if x[1]-x[0] == ans:
      a = abs(x[1]**(1/5))
      b = abs(x[0]**(1/5))
      if x[1] < 0:
          a = a*(-1)
      if x[0] < 0:
          b = b*(-1)
    #   print(x[1],x[0])
      print(int(a),int(b))
      sys.exit()
Problem p02802 (python)

Fixed submission:
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]
#mondaisuu
N = Line[0]
#teisyutu
M = Line[1]
 
AC_Lists = [""]*N
# print(AC_Lists)
 
for i in range(M):
    input_line = input()
    Line = input_line.split()
    # print(AC_Lists[int(Line[0])-1])
    AC_Lists[int(Line[0])-1] += Line[1][0]
 
AC_count = 0
WA_count = 0
 
for s in AC_Lists:
    # print(s)
    if 'A' in s:
        AC_count += 1
        my_str = s.split("A")
        # print(my_str)
        # print(len(my_str[0]))
        WA_count += len(my_str[0])
    # else:
    #     print(len(s))
    #     WA_count += len(s)
# print(AC_Lists)
 
print(AC_count,WA_count)

Buggy submission (verdict: Runtime Error):
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]
#mondaisuu
N = Line[0]
#teisyutu
M = Line[1]

AC_Lists = [""]*N
# print(AC_Lists)

for i in range(M):
    input_line = input()
    Line = input_line.split()
    print(Line)
    AC_Lists[int(Line[0])-1] += Line[1][0]
    print(AC_Lists)

AC_count = 0
WA_count = 0

for s in AC_Lists:
    # print(s)
    if 'A' in s:
        AC_count += 1
        my_str = s.split("A")
        print(my_str)
        # print(len(my_str[0]))
        WA_count += len(my_str[0])
    else:
        # print(len(s))
        WA_count += len(s)
# print(AC_Lists)

print(AC_count,WA_count)

Buggy submission (verdict: Runtime Error):
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]
#mondaisuu
N = Line[0]
#teisyutu
M = Line[1]

AC_Lists = [""]*N
# print(AC_Lists)

for i in range(M):
    input_line = input()
    Line = input_line.split()
    print(Line)
    AC_Lists[int(Line[0])-1] += Line[1][0]
    print(AC_Lists)

AC_count = 0
WA_count = 0

for s in AC_Lists:
    # print(s)
    if 'A' in s:
        AC_count += 1
        my_str = s.split("A")
        print(my_str)
        # print(len(my_str[0]))
        WA_count += len(my_str[0])
    else:
        # print(len(s))
        WA_count += len(s)
# print(AC_Lists)

print(AC_count,WA_count)