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

Fixed submission:
import fractions
a,b,c,d= map(int,input().split())
count = 0
kou = (c*d) // fractions.gcd(c,d)
#print(kou)
if a % kou == 0:
    hajime = a
else :
    hajime = (kou - a % kou) + a
owari = b - (b % kou)
if a % c == 0:
    chajime = a
else :
    chajime = (c - a % c) + a
cowari = b - (b % c)
if a % d == 0:
    dhajime = a
else :
    dhajime = (d - a % d) + a
dowari = b - (b % d)


kousuu = ((cowari - chajime) // c + 1) + ((dowari - dhajime) // d + 1) - ((owari - hajime) // kou + 1)
sa = b - a + 1
print(sa - (kousuu))
#print(hajime,owari,chajime,cowari,dhajime,dowari,)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d= map(int,input().split())
count = 0
kou = (c*d) // math.gcd(c,d)
#print(kou)
if a % kou == 0:
    hajime = a
else :
    hajime = (kou - a % kou) + a
owari = b - (b % kou)
if a % c == 0:
    chajime = a
else :
    chajime = (c - a % c) + a
cowari = b - (b % c)
if a % d == 0:
    dhajime = a
else :
    dhajime = (d - a % d) + a
dowari = b - (b % d)


kousuu = ((cowari - chajime) // c + 1) + ((dowari - dhajime) // d + 1) - ((owari - hajime) // kou + 1)
sa = b - a + 1
print(sa - (kousuu))
#print(hajime,owari,chajime,cowari,dhajime,dowari,)
Problem p03069 (python)

Fixed submission:
n = int(input())
s = input()
l = [0]*(n+1)
count = 0
for i in range(len(s)) :
    if s[i] == "." :
        count += 1
    l[i+1] = count
siro = l[-1]
ans = 1000000000000000000000
for i in range(n+1):
    ans = min(ans,i-2*l[i]+siro)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
siro = s.count(".")
ren = 0
i = 1
while s[-i] == "#":
    ren += 1
    i += 1
print(min(siro,n-ren-siro))
Problem p03074 (python)

Fixed submission:
n, k = map(int,input().split())
s = input()
ha = []
owa = []
ju = 0
for i in range(len(s)) :
    if s[i] == "1" :
        if ju == 0 :
            ha.append(i)
            ju = 1
    else :
        if ju == 1 :
            owa.append(i - 1)
            ju = 0
if not ha :
    print(len(s))
else :
    if ha[0] != 0 :
        ha.insert(0,0)
        owa.insert(0,0)
    owa.append(len(s)-1)
    if len(ha) != len(owa) :
        ha.append(len(s) - 1)
    #print(ha,owa)
    dai = 0
    for i in range(len(owa) - k) :
        dai = max(dai,owa[i+k] - ha[i] + 1)
    if len(ha) > k :
        print(dai)
    else :
        print(len(s))

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
s = input()
ha = []
owa = []
ju = 0
for i in range(len(s)) :
    if s[i] == "1" :
        if ju == 0 :
            ha.append(i)
            ju = 1
    else :
        if ju == 1 :
            owa.append(i - 1)
            ju = 0
if s == "0" :
    print(1)
else :
    if ha[0] != 0 :
        ha.insert(0,0)
        owa.insert(0,0)
    owa.append(len(s)-1)
    if len(ha) != len(owa) :
        ha.append(len(s) - 1)
    #print(ha,owa)
    dai = 0
    for i in range(len(owa) - k) :
        dai = max(dai,owa[i+k] - ha[i] + 1)
    if len(ha) > k :
        print(dai)
    else :
        print(len(s))

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
s = input()
ha = []
owa = []
ju = 0
for i in range(len(s)) :
    if s[i] == "1" :
        if ju == 0 :
            ha.append(i)
            ju = 1
    else :
        if ju == 1 :
            owa.append(i - 1)
            ju = 0
if ha[0] != 0 :
    ha.insert(0,0)
    owa.insert(0,0)
owa.append(len(s)-1)
if len(ha) != len(owa) :
    ha.append(len(s) - 1)
#print(ha,owa)
dai = 0
for i in range(len(owa) - k) :
    dai = max(dai,owa[i+k] - ha[i] + 1)
if len(ha) > k :
    print(dai)
else :
    print(len(s))

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
s = input()
ha = []
owa = []
ju = 0
for i in range(len(s)) :
    if s[i] == "1" :
        if ju == 0 :
            ha.append(i)
            ju = 1
    else :
        if ju == 1 :
            owa.append(i - 1)
            ju = 0
if ha[0] != 0 :
    ha.insert(0,0)
    owa.insert(0,0)
owa.append(len(s)-1)
if ha[-1] != len(s) - 1 :
    ha.append(len(s) - 1)
#print(ha,owa)
dai = 0
for i in range(len(owa) - k) :
    dai = max(dai,owa[i+k] - ha[i] + 1)
if len(ha) > k :
    print(dai)
else :
    print(len(s))
Problem p03087 (python)

Fixed submission:
n,q= map(int,input().split())
s = input()
l = [list(map(int,input().split())) for i in range(q)]
sa = [0]*n
for i in range(0,len(s)-1):
    if s[i] == "A" and s[i+1] == "C":
        sa[i+1] = sa[i] + 1
    else:
        sa[i+1] = sa[i]

""" A C D D D A C A C """
"""0 1 1 1 1 1 2 2 3  """
for si, syu in l:
    print(sa[syu-1] - sa[si-1])

Buggy submission (verdict: Runtime Error):
n, q = list(map(int,input().split()))
s = input()
l = []
for i in range(q) :
    l.append(list(map(int,input().split())))
pla = []
for i in range(len(s)) :
    if s[i] == "A" :
        if s[i+1] == "C" :
            pla.append(i)
for i in l :
    count = 0
    st = 0
    en = 0
    for j in range(len(pla)) :
        if i[0] - 1  <= pla[j] :
            st = j
            break
    for j in range(1,len(pla) - 1) :
        if pla[-j] < i[1] - 1 :
            en = len(pla) - 1
            break
    print(en-st+1)

Buggy submission (verdict: Runtime Error):
n, q = list(map(int,input().split()))
s = input()
l = []
for i in range(q) :
    l.append(list(map(int,input().split())))
pla = []
for i in range(len(s)) :
    if s[i] == "A" :
        if s[i+1] == "C" :
            pla.append(i)
for i in l :
    count = 0
    for j in pla :
        if i[0] - 1 <= j < i[1] - 1 :
            count += 1
    print(count)
Problem p03110 (python)

Fixed submission:
n = int(input())
f = 0
k = 0
a = []
for i in range(n) :
    a = input().split()
    if a[1] == "JPY" :
        f +=  float(a[0])
    else :
        k += float(a[0])
print(f + k *380000 )

Buggy submission (verdict: Runtime Error):
n = int(input())
f = 0
k = 0
for i in range(n) :
    a = input().split("")[1] == "JPY"
    if a[1] == "JPY" :
        f +=  int(a[0])
    else :
        k += int(a[0])
print(f + k *380000 )
Problem p03160 (python)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
def memo(n) :
    me = [0]*(n)
    global l
    me[0] = 0
    me[1] = abs(l[0] - l[1])
    def f(n) :
        for i in range(2, n) :
            me[i] = min([me[i - 2] + abs(l[i - 2] - l[i]),me[i - 1] + abs(l[i - 1] - l[i])])
        return me[n-1]
    return f(n)
print(memo(n))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
def memo(n) :
    me = [-1]*(n+1)
    global l
    def f(n) :
        if n == 0 :
            return 0
        elif n == 1 :
            return abs(l[0] - l[1])
        else :
            if me[n] != -1 :
                return me[n]
            else :
                me[n] = min([f(n - 2) + abs(l[n - 2] - l[n]),f(n - 1) + abs(l[n - 1] - l[n])])
                return me[n]
    return f(n)
print(memo(n - 1))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
def memo(n) :
    me = [0]*(n+1)
    global l
    def f(n) :
        if n == 0 :
            return 0
        elif n == 1 :
            return abs(l[0] - l[1])
        else :
            if me[n] != 0 :
                return me[n]
            else :
                me[n] = min([f(n - 2) + abs(l[n - 2] - l[n]),f(n - 1) + abs(l[n - 1] - l[n])])
                return me[n]
    return f(n)
print(memo(n - 1))
Problem p02786 (python)

Fixed submission:
def myfunc(N):
	if(N  <= 1):
		return 1
	return 2 * myfunc(int(N/2)) + 1

if __name__ == "__main__":
	N = int(input())
	print(myfunc(N))

Buggy submission (verdict: Runtime Error):
def myfunc(N):
	if(N  == 1):
		return 1
	return 2 * myfunc(N/2) + 1

if __name__ == "__main__":
	N = int(input())
	print(myfunc(N))
Problem p02678 (python)

Fixed submission:
from collections import deque

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

path = [[] for _ in range(n)]

for i in range(m):
    a,b = map(int, input().split())
    path[a-1].append(b)
    path[b-1].append(a)
    
d = deque([0])
dis = [-1 for _ in range(n)]
dis[0] = 0

while d:
    hop = d.popleft()
    for i in path[hop]:
        if dis[i-1] == -1:
            d.append(i-1)
            dis[i-1] = hop+1
            
if -1 in dis:
    print('No')
else:
    print('Yes')
    for i in range(1,len(dis)):
        print(dis[i])

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

ab = np.array([])
n,m = map(int, input().split())

for i in range(m):
    ab = np.append(ab, list(map(int, input().split())), axis=0)

ab = ab.reshape(m,2)

Map = np.zeros((n,n),int)

for i in range(m):
    Map[int(ab[i][0]-1)][int(ab[i][1]-1)] = 1
    Map[int(ab[i][1]-1)][int(ab[i][0]-1)] = 1
    
d = deque([0])
dis = np.zeros(n, int)
appended = np.zeros(n)
appended[0] = 1

while len(d) != 0:
    hop = d.popleft()
    col = Map[hop]
    for i in range(len(col)):
        if col[i] == 1 and appended[i] == 0:
            d.append(i)
            dis[i] = hop+1
            appended[i] = 1
    
    hop += 1
    
for i in range(1,len(dis)):
    print(dis[i])
Problem p02687 (python)

Fixed submission:
if input() == 'ABC':
  print('ARC')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
If input() == 'ABC':
  print('ARC')
else:
  print('ABC')
Problem p02694 (python)

Fixed submission:
x = int(input())
l = [1]

total = 100
rate = 1

year = 0

while total < x :
    total = total + total // 100
    year += 1

print(year)

Buggy submission (verdict: Runtime Error):
x = int(input())
l = [1]

total = 100
rate = 1

year = 0

while total < x :
    total = total + total // 100
   year += 1

print(year)
Problem p02719 (python)

Fixed submission:
n,k = map(int, raw_input().split())
from fractions import gcd

if n % k== 0:
  print 0
else:
  mini = n
  s = set()
  while True:
    if n > k:
      n = n % k
    else:
      n = abs(n-k)
    mini = min(n, mini)
    if n in s:
      print mini
      break
    s.add(n)

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

if n % k== 0:
  print 0
else:
  mini = n
  s = set()
  while True:
    if n > k:
      n = n % k
    else:
      n = abs(n-k)
    mini = min(n, mini)
    if n in s:
      print mini
      break
    s.add(n)

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

if n % k== 0:
  print 0
else:
  print gcd(n,k)

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

if n % k== 0:
  print 0
else:
  print gcd(n,k)
Problem p03737 (python)

Fixed submission:
s = raw_input().upper().split()
print s[0][0]+s[1][0]+s[2][0]

Buggy submission (verdict: Runtime Error):
print raw_input()[0]+raw_input()[0]+raw_input()[0]
Problem p03738 (python)

Fixed submission:
a, b  = input(), input()
if a>b:
    print 'GREATER'
elif a<b:
    print 'LESS'
else:
    print 'EQUAL'

Buggy submission (verdict: Runtime Error):
a, b  = input(), input()
if a>b:
    print 'GREATER'
else if a<b:
    print 'LESS'
else:
    print 'EQUAL'
Problem p02684 (python)

Fixed submission:
def LIST():return list(map(int,input().split()))
def MAP():return map(int,input().split())

n,k=MAP()
a=LIST()
a=[0]+a
s=[0]
loca=1
begin=end=0
temp=[-1]*(2*10**5+1)
for i in range(1,n+1):
    s.append(a[loca])
    loca=a[loca]
    if k==i:
        print(s[i])
        exit()
    if temp[loca]==-1:
        temp[loca]=i
    else:
        begin=temp[loca]
        end=i-1
        break

if begin==0:print(s[(k-1)%n+1])
else:
    k=k-(begin-1)
    s=[0]+s[begin:]
    print(s[(k-1)%(end-begin+1)+1])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(str,input().split()))
a=[0]+a

s="0"
t=1
flag1=0
flag2=0
for i in range(1,n+1):
    if a[t] not in s:
        s+=a[t]
        t=int(a[t])
    else:
        flag1=s.find(a[t])
        flag2=i
        break

if flag1==0:print(s[(k-1)%n+1])
else:
    if k<=flag2-1-1+1:print(s[k])
    else:
        s='0'+s[flag1:flag2]  #上下保持一致，左边加上0
        #print(s)
        print(s[(k-(flag1-1))%(flag2-1-flag1+1)])  #去除非循环节部分后求余

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(str,input().split()))
a=[0]+a

s="0"
t=1
flag1=0
flag2=0
for i in range(1,n+1):
    if a[t] not in s:
        s+=a[t]
        t=int(a[t])
    else:
        flag1=s.find(a[t])
        flag2=i
        break

if flag1==0:print(s[(k-1)%n+1])
else:
    if k<=n:print(s[k])
    else:
        s='0'+s[flag1:flag2]  #上下保持一致，左边加上0
        #print(s)
        print(s[(k-(flag1-1))%(flag2-1-flag1+1)])  #去除非循环节部分后求余
Problem p02732 (python)

Fixed submission:


from collections import Counter
N=int(input())
A=list(map(int,input().split()))
d=dict(Counter(A))
sum=0
s=[]
s.append(0)
for i in range(1,2*10**5+1):
    s.append(s[i-1]+i-1)
for value in d.values():
    sum+=s[value]
for x in A:
    print(sum-(d[x]-1))

Buggy submission (verdict: Runtime Error):
def fac(x):
    if x==1:return 0
    return fac(x-1)+x-1

from collections import Counter
N=int(input())
A=list(map(int,input().split()))
d=dict(Counter(A))
s={}
sum=0
for key,value in d.items():
    k=fac(value)
    s[key]=k
    sum+=k
for x in A:
    print(sum-(d[x]-1))

Buggy submission (verdict: Runtime Error):
def fac(x):
    if x==1:return 0
    return fac(x-1)+x-1

from collections import Counter
N=int(input())
A=list(map(int,input().split()))
l=len(A)
d=dict(Counter(A))
s={}
sum=0
for key,value in d.items():
    k=fac(value)
    s[key]=k
    sum+=k
for x in A:
    print(sum-s[x]+fac(d[x]-1))

Buggy submission (verdict: Runtime Error):
def fac(x):
    if x==1:return 0
    return fac(x-1)+x-1

from collections import Counter
c=Counter()
N=int(input())
A=list(map(int,input().split()))
l=len(A)
t=[]
d={}
for i in range(l):
    t=A.copy()
    del t[i]
    d=dict(Counter(t))
    s=0
    for value in d.values():
        if value>=2:
            s=s+fac(value)
    print(s)
Problem p02783 (python)

Fixed submission:
h,a= map(int, input().split())
print((h+a-1)//a)

Buggy submission (verdict: Runtime Error):
h=int(input())
a=int(input())
print((h+a-1)//a)
Problem p02784 (python)

Fixed submission:
h,n=map(int,input().split())
a=input()
list=a.split()
sum=0
for item in list:
    sum=sum+int(item)
#print(sum)
if sum>=h:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
a=input()
list=a.split()
sum=0
for i in range(n-1):
    sum=sum+int(input())
#print(sum)
if sum>=h:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
sum=0
for i in range(n):
    a=int(input())
    sum=sum+a
if sum>=h:
    print("yes")
else:
    print("no")
Problem p02909 (python)

Fixed submission:
s=input()
l=["Sunny","Cloudy","Rainy","Sunny"]
print(l[l.index(s)+1])

Buggy submission (verdict: Runtime Error):
s=input()
l=["Suny","Cloudy","Rainy","Sunny"]
print(l[l.index(s)+1])
Problem p03377 (python)

Fixed submission:
a,b,x=map(int,input().split())
if a<=x<=a+b:print("YES")
else:print("NO")

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input())
if x>=a+b:print("YES")
else:print("NO")
Problem p02555 (python)

Fixed submission:
import sys
N = int(input())
if N>=4:
    C=[0]*N
    C[0]=0
    C[1]=0
    C[2]=1
    n=2
    #フィボナッチ数列のイメージ
    while True:
        n=n+1
        C[n]=C[n-1]+C[n-3]
        #print(n,C[n])
        if n==(N-1):
            break
    print(C[N-1]%(10**9+7))
if N==3:
    print(1)
if N<=2:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
C=[0]*N
C[0]=0
C[1]=0
C[2]=1
n=2
#フィボナッチ数列のイメージ
while True:
    n=n+1
    C[n]=C[n-1]+C[n-3]
    #print(n,C[n])
    if n==(N-1):
        break
print(C[N-1]%(10**9+7))
Problem p02600 (python)

Fixed submission:
X= int(input())
if 399<X and X<600:
    print(8)
if 599<X and X<800:
    print(7)
if 799<X and X<1000:
    print(6)
if 999<X and X<1200:
    print(5)
if 1199<X and X<1400:
    print(4)
if 1399<X and X<1600:
    print(3)
if 1599<X and X<1800:
    print(2)
if 1799<X and X<2000:
    print(1)

Buggy submission (verdict: Runtime Error):
N,  K= map(int, input().split())
A = list(map(int, input().split()))
 
for i in range(0,N-K):
    if  A[i]<A[i+K]:
        print('Yes')
    else:
        print('No')
Problem p02603 (python)

Fixed submission:
N=int(input())
A = list(map(int, input().split()))
money=1000
stock=0
if A[0]<A[1]:
    stock=int(money/A[0])
    money=money-A[0]*stock
for i in range(1,N-1):
    if A[i-1]<A[i]:
        money=money+A[i]*stock
        stock=0
    if A[i]<A[i+1]:
        stock=int(money/A[i])
        money=money-A[i]*stock
money=money+A[N-1]*stock        
print(money)

Buggy submission (verdict: Runtime Error):
N=int(input())
A = list(map(int, input().split()))
money=1000
stock=0
if A[0]<A[1]:
    stock=int(money/A[0])
    money=money-A[i]*stock
for i in range(1,N-1):
    if A[i-1]<A[i]:
        money=money+A[i]*stock
        stock=0
    if A[i]<A[i+1]:
        stock=int(money/A[i])
        money=money-A[i]*stock
money=money+A[N-1]*stock        
print(money)
Problem p02606 (python)

Fixed submission:
l, r, D = input().split()
L=int(l)
R=int(r)
d=int(D)
s=0
for i in range(L,R+1):
    if i%d==0:
        s=s+1
print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
for n in range(1,N+1):
    s=0
    for x in range(1,50):  
        for y in range(x,50):
            for z in range(y,50):
                fn=x*x+y*y+z*z+x*y+y*z+z*x
                if fn==n and x==y and x==z:
                    s=s+1
                if fn==n and x<y and y==z:
                    s=s+3
                if fn==n and x==y and y<z:
                    s=s+3              
                if fn==n and x<y and y<z:
                    s=s+6    
    print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
for n in range(1,N+1):
    s=0
    for x in range(1,101):
        for y in range(x,101):
            for z in range(y,101):
                fn=x*x+y*y+z*z+x*y+y*z+z*x
                if fn==n and x==y and x==z:
                    s=s+1
                if fn==n and x<y and y==z:
                    s=s+3
                if fn==n and x==y and y<z:
                    s=s+3              
                if fn==n and x<y and y<z:
                    s=s+6    
    print(n,s)
Problem p02607 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
s=0
for i in range(0,N,2):
    if A[i]%2 !=0:
        s=s+1
print(s)

Buggy submission (verdict: Runtime Error):
N=input()
a=0
for i in range(0,int(N),2):
    s=input()
    if s%2!=0:
        a=a+1
print(a)
Problem p02731 (python)

Fixed submission:
a= int(input())
b=float(a/3.00000000)
print(b*b*b)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
a= input().split() 
b=Decimal(a/3)
print(b*b*b)
Problem p03323 (python)

Fixed submission:
a,b =map(int, input().split()) 
if a<=8 and b<=8:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
a,b =int(input.split())
if a<=8 and b<=8:
  print('Yay!')
 else:
  print(':(')
Problem p02612 (python)

Fixed submission:
n = int(input())
result = 1000 - n % 1000

if result == 1000:
    print(0)
else:
    print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
result = n % 1000

pirnt(result)
Problem p02576 (python)

Fixed submission:
n,x,t = map(int, input().split())
if n%x==0:
  print((n//x)*t)
else:
  print((n//x + 1)*t)

Buggy submission (verdict: Runtime Error):
n,x,t = map(int, input().split())
if n%x=0:
  print((n//x)*t)
else:
  print((n//x + 1)*t)
Problem p02601 (python)

Fixed submission:
a, b, c = map(int, input().split())
k = int(input())
ans= 0
 
for i in range(k):
  if a < b*(2**i) < c*(2**(k-i)):
    ans+=1
  else:
    ans+=0
  
if ans>=1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c= map(int, input().split())
k= int(input())
ans= 0
 
for i in range(k):
  if a < b*(2**i) < c*(2**(k-i)):
    ans+=1
  else:
    ans+=0
  
print(Yes if ans>=1 else No)

Buggy submission (verdict: Runtime Error):
a= int(input())
b= int(input())
c= int(input())
k= int(input())
ans= 0
 
for i in range(k):
  if a < b*(2**i) < c*(2**(k-i)):
    ans+=1
  else:
    ans+=0
  
print(Yes if ans>=1 else No)

Buggy submission (verdict: Runtime Error):
a= int(input())
b= int(input())
c= int(input())
k= int(input())
ans= 0

for i in range(0,4):
  if a < b*(2**i) < c*(2**(k-i)):
    ans+=1
  else:
    ans+=0
  
print(Yes if ans>=1 else No)
Problem p02613 (python)

Fixed submission:
n = int(input())
s = list(input() for i in range(n))
  
print("AC x ",s.count("AC"))
print("WA x ",s.count("WA"))
print("TLE x ",s.count("TLE"))
print("RE x ",s.count("RE"))

Buggy submission (verdict: Runtime Error):
a=[]
w=[]
t=[]
r=[]
n = int(input())
s = list(input().split())

for i in range (n):
  if s[i] == "AC":
    a.append(s[i])
  elif s[i]== "WA":
    w.append(s[i])
  elif s[i]== "TLE":
    t.append(s[i])
  else:
    r.append(s[i])
  
print("AC x ",sum(a))
print("WA x ",sum(w))
print("TLE x ",sum(t))
print("RE x ",sum(r))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input().split())
a=[]
w=[]
t=[]
r=[]

for i in range (n):
  if s[i] == "AC":
    a.append(s[i])
  elif s[i]== "WA":
    w.append(s[i])
  elif s[i]== "TLE":
    t.append(s[i])
  else:
    r.append(s[i])
  
print("AC x ",sum(a))
print("WA x ",sum(w))
print("TLE x ",sum(t))
print("RE x ",sum(r))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input().split())
a=[]
w=[]
t=[]
r=[]

for i in range (n):
  if s[i] == "AC":
    a.append(s[i])
  elif s[i]== "WA":
    w.append(s[i])
  elif s[i]== "TLE":
    t.append(s[i])
  else:
    r.append(s[i])
  
print("AC x ",sum(a))
print("WA x ",sum(w))
print("TLE x ",sum(t))
print("RE x ",sum(r))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input().split())
a=[]
w=[]
t=[]
r=[]

for i in range (n):
  if s[i] == "AC":
    a.append(s[i])
  elif s[i]== "WA":
    w.append(s[i])
  elif s[i]== "TLE":
    t.append(s[i])
  else:
    r.append(s[i])
  
print("AC × ",sum(a))
print("WA × ",sum(w))
print("TLE × ",sum(t))
print("RE × ",sum(r))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input().split())

if s == "AC":
  a = sum(s)
elif s== "WA":
  w = sum(s)
elif s== "TLE":
  t = sum(s)
else:
  e = sum(s)
  
print("AC × ",a)
print("WA × ",w)
print("TLE × ",t)
print("RE × ",r)

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

  if s == "AC":
    a = sum(s)
  elif s== "WA":
    w = sum(s)
  elif s== "TLE":
    t = sum(s)
  else:
    e = sum(s)
  
  print("AC × ",a)
  print("WA × ",w)
  print("TLE × ",t)
  print("RE × ",r)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int, input().split()))
a = 0
w = 0
t = 0
r = 0

for i in range(n):
  if s == "AC":
    a += 1
  elif s== "WA":
    w += 1
  elif s== "TLE":
    t += 1
  else:
    e += 1
  
  print("AC ×", a)
  print("WA ×", w)
  print("TLE ×", t)
  print("RE ×", r)
Problem p02628 (python)

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

print(sum(sorted(p)[:k]))

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

print(sum(sorted(p)[:N]))
Problem p02663 (python)

Fixed submission:
h1,m1,h2,m2,k = map(int, input().split())
print( 60* (h2-h1) + m2 - m1 - k )

Buggy submission (verdict: Runtime Error):
import sys
2 readline = sys.stdin.buffer.readline
3
4 h1, m1, h2, m2, k = map(int, readline().split())
5 print(60 * (h2 - h1) + m2 - m1 - k)

Buggy submission (verdict: Runtime Error):
study = (60*H2 + M2) - (60*H1 + M1) - K
study
Problem p02612 (python)

Fixed submission:
N = int(input())
o = (1000-N%1000)%1000
print(o)

Buggy submission (verdict: Runtime Error):
N = input()
o = 1000-(N%1000) 
print(o)