Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input=sys.stdin.readline
from random import randint
##import numpy as np
##sys.setrecursionlimit(10**7)
mo=10**9+7
def cin():
    return map(int,sin().split())
def ain():            
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
##def gcd(a,b): 
##    if a == 0: 
##        return b 
##    return gcd(b % a, a)
prime1=[]
def SieveOfEratosthenes(n): #list of primes upto n
    global prime1
    prime1 = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime1[p] == True): 
            for i in range(p * p, n+1, p): 
                prime1[i] = False
        p += 1
    f=[]
    for p in range(2, n): 
        if prime1[p]: 
            f.append(p)
    return f

def lcm(a,b): 
    return (a*b) // math.gcd(a,b) 
for _ in range(1):
    n=inin()
    l=ain()
    f1,f2=0,0
    gc=l[0]
    d=dd(int)

    for i in range(1,n):
        gc=math.gcd(gc,l[i])
    if(gc!=1):print("not coprime")
    else:
        lp=SieveOfEratosthenes(k)
        for i in l:
            for j in lp:
                if(i%j==0):
                    if(d[j]==1):
                        f1=1
                        break
                    d[j]=1
            if(f1):break
        if(f1):
            print("setwise coprime")
        else:
            print("pairwise coprime")
        
        
    
    
    

 
    
    
    
    
        
        
    
    
    
    


    




##def msb(n):n|=n>>1;n|=n>>2;n|=n>>4;n|=n>>8;n|=n>>16;n|=n>>32;n|=n>>64;return n-(n>>1) #2 ki power
##def pref(a,n,f):             
##    pre=[0]*n
##    if(f==0):         ##from beginning
##        pre[0]=a[0]
##        for i in range(1,n):
##            pre[i]=a[i]+pre[i-1]
##    else:              ##from end
##        pre[-1]=a[-1]
##        for i in range(n-2,-1,-1):
##            pre[i]=pre[i+1]+a[i]
##    return pre
##maxint=10**24 
##def kadane(a,size): 
##    max_so_far = -maxint - 1
##    max_ending_here = 0
##       
##    for i in range(0, size): 
##        max_ending_here = max_ending_here + a[i] 
##        if (max_so_far < max_ending_here): 
##            max_so_far = max_ending_here 
##  
##        if max_ending_here < 0: 
##            max_ending_here = 0   
##    return max_so_far
##def power(x, y):
##    if(y == 0):return 1
##    temp = power(x, int(y / 2))%mo
##    if (y % 2 == 0):return (temp * temp)%mo 
##    else:
##        if(y > 0):return (x * temp * temp)%mo 
##        else:return ((temp * temp)//x )%mo


Fixed submission:
import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input=sys.stdin.readline
from random import randint
##import numpy as np
#sys.setrecursionlimit(10**7)
mo=10**9+7
def cin():
    return map(int,sin().split())
def ain():            
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())

for _ in range(1):
    a,b,c=cin()
    if(b*1.0>=(a/c)):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
import sys
import bisect as bi
import math
from collections import defaultdict as dd
input=sys.stdin.readline
##sys.setrecursionlimit(10**7)
def cin():
    return map(int,sin().split())
def ain():            
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
for _ in range(1):
    s=input().strip()
    p=s.index('R');n=len(s)
    ans=0
    if('R' in s):
        c=1
        for i in range(p+1,n):
            if(s[i]=='R'):
                c+=1
            else:
                ans=max(ans,c)
                c=0
        ans=max(ans,c)
    print(ans)
        
        


Fixed submission:
import sys
import bisect as bi
import math
from collections import defaultdict as dd
input=sys.stdin.readline
##sys.setrecursionlimit(10**7)
def cin():
    return map(int,sin().split())
def ain():            
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
for _ in range(1):
    s=input().strip()
    n=len(s)
    ans=0
    if('R' in s):
        p=s.index('R');
        c=1
        for i in range(p+1,n):
            if(s[i]=='R'):
                c+=1
            else:
                ans=max(ans,c)
                c=0
        ans=max(ans,c)
    print(ans)
Buggy python submission (verdict: Runtime Error):
# C - Snack
from math import gcd
A, B = map(int, input().split())
ans = A
while ans % B != 0:
    ans += A
print(ans)

Fixed submission:
from fractions import *
a, b=map(int, input().split())
print(a * b // gcd(a, b))

Buggy python submission (verdict: Runtime Error):
# C - Snack
from math import gcd
A, B = map(int, input().split())
i = 1 
ans = A
while ans % B != 0:
    i += 1
    ans = A * i
print(ans)

Fixed submission:
from fractions import *
a, b=map(int, input().split())
print(a * b // gcd(a, b))

Buggy python submission (verdict: Runtime Error):
# C - Snack
from math import gcd
A, B = map(int, input().split())
print(A * B // gcd(A, B))

Fixed submission:
from fractions import *
a, b=map(int, input().split())
print(a * b // gcd(a, b))

Buggy python submission (verdict: Runtime Error):
# C - Snack
from math import gcd
A, B = map(int, input().split())
print(int(A * B / gcd(A, B)))

Fixed submission:
from fractions import *
a, b=map(int, input().split())
print(a * b // gcd(a, b))
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A + B >= C - 1:
    print("{}".format(B+C)
else:
    print("{}".format(A+2*B+1))

Fixed submission:
A, B, C = map(int, input().split())
if A + B >= C - 1:
    print(B+C)
else:
    print(A+2*B+1)
Buggy python submission (verdict: Runtime Error):
x,y = (map(int,input().split()))

if y%2 != 0:
    print('No')
elif 2*x <= y <= 4*x:
    print('Yes')
else:
    print('No')

Fixed submission:
x = list(map(int,input().split()))
for i in range(6):
    if i not in x:
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
def gcd(x,y):
    x,y = max(x,y),min(x,y)
    while(y>0):
        x,y = y,x%y
    return(x)
    
def lcm(a,b):
    return(int(a*b/gcd(a,b)))

n = int(input())
a = list(map(int,input().split()))
least_common_multiple = 1
for i in range(n):
    least_common_multiple = lcm(least_common_multiple,a[i])
ans = 0
for i in range(n):
    ans += (least_common_multiple-1)%a[i]
print(ans)

Fixed submission:
import numpy as np
n = int(input())
a = np.array(list(map(int,input().split())))-1
print(a.sum())

Buggy python submission (verdict: Runtime Error):
def gcd(x,y):
    x,y = max(x,y),min(x,y)
    while(y>0):
        x,y = y,x%y
    print(x)
def lcm(a,b):
    return(int(a*b/gcd(a,b)))

n = int(input())
a = list(map(int,input().split()))
least_common_multiple = 1
for i in range(n):
    least_common_multiple = lcm(least_common_multiple,a[i])
ans = 0
for i in range(n):
    ans += (least_common_multiple-1)%a[i]
print(ans)

Fixed submission:
import numpy as np
n = int(input())
a = np.array(list(map(int,input().split())))-1
print(a.sum())

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int,input().split()))
least_common_multiple = 1
for i in range(n):
    least_common_multiple = int(least_common_multiple*a[i]/math.gcd(least_common_multiple,a[i]))
ans = 0
for i in range(n):
    ans += (least_common_multiple-1)%a[i]
print(ans)

Fixed submission:
import numpy as np
n = int(input())
a = np.array(list(map(int,input().split())))-1
print(a.sum())

Buggy python submission (verdict: Runtime Error):
import math
def lcm(a,b):
    return(int(a*b/math.gcd(a,b)))

n = int(input())
a = list(map(int,input().split()))
least_common_multiple = 1
for i in range(n):
    least_common_multiple = lcm(least_common_multiple,a[i])
ans = 0
for i in range(n):
    ans += (least_common_multiple-1)%a[i]
print(ans)

Fixed submission:
import numpy as np
n = int(input())
a = np.array(list(map(int,input().split())))-1
print(a.sum())
Buggy python submission (verdict: Time Limit Exceeded):
import copy
n,m = map(int,input().split())
ab = [tuple(map(int,input().split())) for _ in range(m)]
bridge = [0 for _ in range(n)]
bridge_m = [[] for _ in range(n)]
for i in range(m):
    for j in range(ab[i][0],ab[i][1]):
        bridge[j] +=1
        bridge_m[j].append(i)
cnt =0
max_ = max(bridge)
while(max_!=0):
    argmax = bridge.index(max_)
    delete = copy.deepcopy(bridge_m[argmax])
    for i in delete:
        for j in range(ab[i][0],ab[i][1]):
            bridge[j] -=1
            bridge_m[j].remove(i)
    cnt +=1
    max_ =max(bridge)
print(cnt)

Fixed submission:
n,m = map(int,input().split())
ab = [tuple(map(int,input().split())) for _ in range(m)]
ab.sort(key=lambda x:x[1])
last=-1
cnt=0
for i in range(len(ab)):
    if(ab[i][0]<=last):pass
    else:
        last=ab[i][1]-1
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n, m, d = map(int,input().split())
pnt = 0.
if d==0:
    pnt = max(n*(m-2),1)/n**2
else:
    a = max(n-2*d,0)
    pnt = ((a*2 +(n-a))**(m-1))*max(n*(m-2),1)
    for i in range(m):
        pnt /= n
print(pnt)

Fixed submission:
n, m, d = map(int,input().split())
pnt = 0.
if d==0:
    pnt = (1./n)*(m-1)
else:
    a = max(n-2*d,0)
    pnt = ((a*2 +(n-a))/n**2)*(m-1)
print(pnt)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
a =[0 for i in range(n)]
for i in range(n):
    if s[i]=="E":
        for j in range(i):
            a[j]+=1
    else:
        for j in range(i+1,n):
            a[j]+=1
print(min(a))

Fixed submission:
n=int(input())
s=input()
a=[0 for i in range(n)]
east,west =0,0
for i in range(n):
    a[i]+=west
    if s[i]=="W":
        west+=1
for i in range(n-1,-1,-1):
    a[i]+=east
    if s[i]=="E":
        east+=1
print(min(a))
Buggy python submission (verdict: Runtime Error):
a =[]
for i in range(4):
 a[i] = int(input())
print((min(a[0],a[1])+min(a[2],a[3])))


Fixed submission:
a =[]
for i in range(4):
 a.append(int(input()))
print((min(a[0],a[1])+min(a[2],a[3])))
Buggy python submission (verdict: Runtime Error):
H, W = [int(n) for n in input().split()]
for i in range(H):
    image = []
    image.append(input())

print("#"*(W+2))
for i in range(H):
    print("#"+image[i]+"#")
print("#"*(W+2))


Fixed submission:

H, W = [int(n) for n in input().split()]
image = []
for i in range(H):
    image.append(input())

print("#"*(W+2))
for i in range(H):
    print("#"+image[i]+"#")
print("#"*(W+2))

Buggy python submission (verdict: Runtime Error):
H, W = [int(n) for n in input().split()]
for i in range(H):
    image = []
    image.append(input())

print("#"*(W+2))
for i in range(H):
    print("#"+image(i)+"#")
print("#"*(W+2))

Fixed submission:

H, W = [int(n) for n in input().split()]
image = []
for i in range(H):
    image.append(input())

print("#"*(W+2))
for i in range(H):
    print("#"+image[i]+"#")
print("#"*(W+2))
Buggy python submission (verdict: Runtime Error):

pattern = ["maerd", "remaerd", "esare", "resare"]

def rec(s):
    if (len(s) == 0):
        return True

    for candidate in pattern:
        if s[:len(candidate)] == candidate:
            rec(s[len(candidate):])
            return True

    return False

def main():
    S = input()
    S = S[::-1]

    if rec(S):
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main()

Fixed submission:

S = input()
S = S[::-1]

pattern = ['maerd', 'remaerd', 'esare', 'resare']

pos = 0
possible = True

while pos < len(S):
    no_match = True
    for candidate in pattern:
        if S[pos : pos + len(candidate)] == candidate:
            pos += len(candidate)
            no_match = False
            break

    if no_match:
        possible = False
        break

if possible:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
k=input()
ans=7
ans2=10
prev=7
if ans%k==0:
    print(1)
else:
    for i in range(0, k + 1, 1):
        ans=7*ans2+prev
        if ans%k==0:
            print(i+2)
            break
        prev=ans
        ans2=ans2*10



Fixed submission:
k=int(input())
ans=7
ans2=10
prev=7
hbe=False
if ans%k==0:
    print(1)
    hbe=True
else:
    for i in range(0, k + 1, 1):
        ans=(7*ans2+prev)%k
        if ans%k==0:
            print(i+2)
            hbe=True
            break
        prev=ans
        ans2=(ans2*10)%k
if hbe==False:
    print(-1)
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x == 0: pritn(1)
else: print(0)

Fixed submission:
x = int(input())

if x == 0: print(1)
else: print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
 
s = 0
for i in range(N):
  s += A[i]
  s %= (10**9+7)
s = s**2
s %= (10**9+7)
 
t = 0
for i in range(N):
  t += (A[i]**2 % (10**9+7))
t %= (10**9+7)

ans = (s-t) % (10**9+7)
tmp = (2**1000000005) % (10**9+7)
ans *= tmp
ans %= (10**9+7)
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
s = 0
for i in range(N):
  s += A[i]
  s %= (10**9+7)
s = s**2
s %= (10**9+7)
 
t = 0
for i in range(N):
  t += (A[i]**2 % (10**9+7))
t %= (10**9+7)
 
ans = (s-t) % (10**9+7)
'''
tmp = (2**1000000005) % (10**9+7)
'''
tmp = 500000004
ans *= tmp
ans %= (10**9+7)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

s = 0
for i in range(1, N+1):
  for j in range(i+1, N+1):
    s += A[i-1]*A[j-1]
    
s = s % (10**9 + 7)
print(s)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
s = 0
for i in range(N):
  s += A[i]
  s %= (10**9+7)
s = s**2
s %= (10**9+7)
 
t = 0
for i in range(N):
  t += (A[i]**2 % (10**9+7))
t %= (10**9+7)
 
ans = (s-t) % (10**9+7)
'''
tmp = (2**1000000005) % (10**9+7)
'''
tmp = 500000004
ans *= tmp
ans %= (10**9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split())) 
s = [0]*(N-1)
 
for n in range(N-1):
  s[n] = A[n] - A[n+1]
  if s[n] <= 0: 
    continue
  else:
    A[n+1] += s[n]

print(sum(int(s)))

Fixed submission:
import math
N, X, T = map(int, input().split())

print(math.ceil(N / X)*T)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split())) 
ans = 0
 
for n in range(N-1):
  t = A[n] - A[n+1]
  if t <= 0: 
    continue
  else:
    A[n+1] += t
    ans += t
 
print(ans)

Fixed submission:
import math
N, X, T = map(int, input().split())

print(math.ceil(N / X)*T)
Buggy python submission (verdict: Runtime Error):
N = list(map(int, str(input())))

s = 0
for n in range(N):
  s += n

if(s % 9 == 0): print('Yes')
else: print('No')

Fixed submission:
N = list(map(int, str(input())))
s = sum(N)
 
if(s % 9 == 0): print('Yes')
else: print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split())) 
s = [0]*(N-1)
 
for n in range(N-1):
  s[n] = A[n] - A[n+1]
  if s[n] <= 0: 
    continue
  else:
    A[n+1] += s[n]
 
print(min(s))

Fixed submission:
N = int(input())
A = list(map(int, input().split())) 
ans = 0
 
for n in range(N-1):
  t = A[n] - A[n+1]
  if t <= 0: continue
  else:
    A[n+1] += t
    ans += t

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)]
t = [0]*(N-1)
 
for n in range(N-1):
  t[n] = s[n] - s[n+1]
  if t[n] <= 0: 
    continue
  else:
    s[n+1] += t[n]
 
print(min(t))

Fixed submission:
N = int(input())
A = list(map(int, input().split())) 
ans = 0
 
for n in range(N-1):
  t = A[n] - A[n+1]
  if t <= 0: continue
  else:
    A[n+1] += t
    ans += t

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)]
t = [0]*(N-1)

for n in range(N-1):
  t[n] = s[n] - s[n+1]
  if t[n] <= 0: 
    continue
  else:
    s[n+1] += t[n]

print(min(t))

Fixed submission:
N = int(input())
A = list(map(int, input().split())) 
ans = 0
 
for n in range(N-1):
  t = A[n] - A[n+1]
  if t <= 0: continue
  else:
    A[n+1] += t
    ans += t

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)]

print(N, s)

Fixed submission:
N = int(input())
A = list(map(int, input().split())) 
ans = 0
 
for n in range(N-1):
  t = A[n] - A[n+1]
  if t <= 0: continue
  else:
    A[n+1] += t
    ans += t

print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
 
# 高々2^3=8通りなので、全て列挙すればよい
# RRR RRS SRR RSR RSS SRS SSR SSS
ans = 0
if S == 'RRR': ans = 3
elif S == 'SRR' and S == 'RRS': ans = 2
elif S == 'SSS': ans = 0
else: ans = 1
  
print(ans)

RSR SSR SRS RSS 

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

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
ans = 0
for i in range(N):
  for j in range(i+1, N):
    for k in range(j+1, N):
      if(L[i] != L[j] and L[i] != L[k] and L[j] != L[k] and abs(L[j]-L[k]) < L[i] and L[i] < L[j]+L[k]):
          ans +=1
          
print(ans)

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

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
ans = 0
if(N >= 3):
  t = []
  for i in range(N):
    for j in range(i+1, N):
      for k in range(j+1, N):
        if((abs(L[j]-L[k]) < L[i]) & (L[i] < L[j]+L[k])): t.append((L[i], L[j], L[k]))
  ans = len(set(t))

print(ans)

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

Buggy python submission (verdict: Runtime Error):
S = input()
 
ans = 0
if S == 'RRR': ans = 3
else:
  if ('RR' in S) ans = 2
  else:
    if('R' in S) ans = 1
    else: ans = 0

print(ans)

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

Buggy python submission (verdict: Runtime Error):
S = input()
 
ans = 0
if S ='RRR': ans = 3
else:
  if ('RR' in S) ans = 2
  else:
    if('R' in S) ans = 1
    else: ans = 0

print(ans)

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

Buggy python submission (verdict: Runtime Error):
S = input()

ans = 0
if S ='RRR': ans = 3
else:
  if ('RR' in S) ans = 2
  else:
    if('R' in S) ans = 1
    else: ans = 0
    
print(ans)

Fixed submission:
S = input()
 
ans = 0
if S == 'RRR': ans = 3
else:
  if ('RR' in S): ans = 2
  else:
    if('R' in S): ans = 1
    else: ans = 0
 
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
ans = 0
for i in range(N):
  for j in range(i+1, N):
    for k in range(j+1, N):
      if(L[i] != L[j] and L[i] != L[k] and L[j] != L[k] and abs(L[j]-L[k]) < L[i] and L[i] < L[j]+L[k]): t.append((L[i], L[j], L[k])):
          ans +=1
          
print(ans)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
 
ans = 0
if(N >= 3):
  t = []
  for i in range(N):
    for j in range(i+1, N):
      for k in range(j+1, N):
        if((L[i] != L[j]) & (L[i] != L[k]) & (L[j] != L[k]) & (abs(L[j]-L[k]) < L[i]) & (L[i] < L[j]+L[k])): t.append((L[i], L[j], L[k]))
  ans = len(t)

print(ans)

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

ans = 0
t = []
if(N >= 3):
  for i in range(N):
    for j in range(N):
      for k in range(N):
        if((abs(j-k) < a) && (a < j+k)): t.append([i, j, k])

t = list(set(t))
print(len(t))

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
 
ans = 0
if(N >= 3):
  t = []
  for i in range(N):
    for j in range(i+1, N):
      for k in range(j+1, N):
        if((L[i] != L[j]) & (L[i] != L[k]) & (L[j] != L[k]) & (abs(L[j]-L[k]) < L[i]) & (L[i] < L[j]+L[k])): t.append((L[i], L[j], L[k]))
  ans = len(t)

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
 
ac = 0
wa = 0
tle = 0
re = 0
for s in S:
  if s == 'AC': ac += 1
  elif s == 'WA': wa += 1
  elif s == 'TLE': tle += 1
  elif s == 'RE': re += 1

print('AC x ' + ac)
print('WA x ' + wa)
print('TLE x ' + tle)
print('RE x ' + re)

Fixed submission:
N = int(input())
S = [input() for i in range(N)]
 
ac = 0
wa = 0
tle = 0
re = 0
for s in S:
  if s == 'AC': ac += 1
  elif s == 'WA': wa += 1
  elif s == 'TLE': tle += 1
  elif s == 'RE': re += 1

print('AC x ' + str(ac))
print('WA x ' + str(wa))
print('TLE x ' + str(tle))
print('RE x ' + str(re))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]

ac = 0
wa = 0
tle = 0
re = 0
for s in S:
  if s == 'AC': ac += 1
  elif s == 'WA': wa += 1
  elif s == 'TLE': tle += 1
  elif s == 'RE'; re += 1

print('AC x ' + ac)
print('WA x ' + wa)
print('TLE x ' + tle)
print('RE x ' + re)

Fixed submission:
N = int(input())
S = [input() for i in range(N)]
 
ac = 0
wa = 0
tle = 0
re = 0
for s in S:
  if s == 'AC': ac += 1
  elif s == 'WA': wa += 1
  elif s == 'TLE': tle += 1
  elif s == 'RE': re += 1

print('AC x ' + str(ac))
print('WA x ' + str(wa))
print('TLE x ' + str(tle))
print('RE x ' + str(re))
Buggy python submission (verdict: Runtime Error):
S = list(input())
T = list(input())

ans = 0
for i in range(len(S)):
  if s[i] != T[i]: ans += 1
print(ans)

Fixed submission:
S = list(input())
T = list(input())
 
ans = 0
for i in range(len(S)):
  if S[i] != T[i]: ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
 
ans = 1
for i in range(N):
  ans *= A[i]

if ans > 10**18: ans = '-1'
print(ans)

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

ans = 0
if 0 not in A:
  ans = 1
  for i in range(N):
    ans *= A[i]
    if ans > 10**18:
      ans = '-1'
      break

print(ans)

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

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

if ans > 10**18: ans = '-1'
print(ans)

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

ans = 0
if 0 not in A:
  ans = 1
  for i in range(N):
    ans *= A[i]
    if ans > 10**18:
      ans = '-1'
      break

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

X, Y = A*math.cos(math.pi*(60*H+M)/360), -A*math.sin(math.pi*(60*H+M)/360)
x, y = B*math.cos(math.pi*M/30), -B*math.sin(math.pi*M/30)

print(math.sqrt((X-x)**2+(Y-y)**2))

Fixed submission:
import math
A, B, H, M = map(int, input().split())
 
X, Y = A*math.cos(math.pi*(60*H+M)/360), -A*math.sin(math.pi*(60*H+M)/360)
x, y = B*math.cos(math.pi*M/30), -B*math.sin(math.pi*M/30)
 
print(math.sqrt((X-x)**2+(Y-y)**2))
Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())

l = [1]*A + [0]*B + [-1]*C
ans = sum(l[:K])

print(ans)

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

ans = 0
if A > K:
  ans += 1*K
else:
  ans += 1*A
  K = K - A
  if B > K: 
    ans += 0*K
  else:
    ans += 0*B
    K = K - B
    if C > K:
      ans += -1*K
    else:
      ans += -1*C

print(ans)