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

Fixed submission:
from sys import stdin

n, m = (int(x) for x in stdin.readline().rstrip().split())
lr = [stdin.readline().rstrip().split() for _ in range(m)]
l = max([int(i[0]) for i in lr])
r = min([int(i[1]) for i in lr])

if l <= r:
    print(r-l+1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
from sys import stdin

n, m = (int(x) for x in stdin.readline().rstrip().split())
lr = [stdin.readline().rstrip().split() for _ in range(m)]
l = max([i[0] for i in lr])
r = min([i[1] for i in lr])

if l <= r:
    print(r-l+1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
from sys import stdin

n, m = (int(x) for x in stdin.readline().rstrip().split())
s = int()
e = int()
for i in range(m):
    line = stdin.readline().rstrip().split()
    if i == 0:
        s = int(line[0])
        e = int(line[1])
    else:
        if s <= int(line[0]) <= e:
            s = int(line[0])
        if s <= int(line[1]) <= e:
            e = line[1]

print(len([i for i in range(s, e+1) if 1 <= i <= n]))
Problem p03470 (python)

Fixed submission:
def main():
    N = int(input())
    x = []
    for i in range(N):
        x.append(int(input()))
    a = sorted(list(set(x)))
    print(len(a))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
  N = int(input())
  x = []
  for i in range(N):
    x.append(int(input())
  a = sorted(list(set(x)))
  print(len(a))
             
if __name__ == '__main__':
	main()
Problem p03545 (python)

Fixed submission:
def main():
    a = input()
    n = 3
    op = ['']*n
    for i in range(1 << n):
        total = int(a[0])
        for j in range(n):
            if 1 & (i >> j):
                total += int(a[j+1])
                op[j] = '+'
            else:
                total -= int(a[j+1])
                op[j] = '-'
        if total == 7:
            break
    ans = a[0]
    for i in range(n):
        ans += op[i]+a[i+1]
    ans += '=7'
    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    s = input()
    for i in range(1<<3):
        t = int(s[0])
        op = []
        for j in range(3):
            if 1 & (i>>j):
                t += int(s[j+1])
                op.append('+')
            else:
                t -= int(s[j+1])
                op.append('-')
        if t == 7:
            x = [f'{a}{b}' for a,b in zip(s, op)]
            print(f'{"".join(x)}{s[-1]}=7')
            break

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

Fixed submission:
import itertools

s = input()
n = [i for i in s]
ans = 0

for i in range(len(n)):
    for j in itertools.combinations(range(len(n)-1), i):
        temp = [i for i in s]
        for k in j[::-1]:
            temp.insert(k+1, "+")
        temp = "".join(temp)
        temp = temp.split("+")
        temp = map(int, temp)
        ans += sum(temp)

print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

s = input()
n = [i for i in s]
ans = 0

for i in range(len(n)):
  for j in itertools.combinations(range(len(n)-1, i)):
    temp = [i for i in s]
    for k in j[::-1]:
      temp.insert(k+1, "+")
    temp = "".join(temp)
    temp = temp.split("+")
    temp = map(int, temp)
    ans += sum(temp)

print(ans)
Problem p04029 (python)

Fixed submission:
n = int(input())
a = [x for x in range(1,n+1)]
print(sum(a))

Buggy submission (verdict: Runtime Error):
def main():
  N = int(input())
  print(sum([x for x in range(1,N+1)])

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

Fixed submission:
a,o,b=input().split()
a=int(a)
b=int(b)
print(a+b if o=="+" else a-b)

Buggy submission (verdict: Runtime Error):
a, op, b = map(int, input().split())
op = str(op)
 
if p == "+":
  print(a+b)
else:
  print(a-b)

Buggy submission (verdict: Runtime Error):
a, op, b = map(int, input().split())
op = str(op)
 
if op == "+":
  print(a+b)
else:
  print(a-b)

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

if p == "+":
  print(a+b)
else:
  print(a-b)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
op = a[1]
x = a[0]
y = a[2]
 
if op == "+":
  print(x+y)
else:
  print(x-y)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
op = a[1]
 
if op == "+":
  print(int(a[0])+int(a[2]))
else:
  print(int(a[0])-int(a[2]))

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
op = a[1]

if op == "+":
  print(a[0]+a[2])
else:
  print(a[0]-a[2])

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
x = int(x[1])

print(x[0]x[1]x[2])
Problem p03852 (python)

Fixed submission:
x = str(input())
if x == "a" or x == "i" or x == "u" or x == "e" or x == "o":
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
x = str(input())
if x = "a" or x = "i" or x = "u" or x = "e" or x = "o":
  print("vowel")
else:
  print("consonant")
Problem p03860 (python)

Fixed submission:
a = list(map(str,input().split()))
x = a[1]
print("A"+ x[0] + "C")

Buggy submission (verdict: Runtime Error):
a, b, c = str(input().split())
print(a[0]+b[0]+c[0])
Problem p03943 (python)

Fixed submission:
x = list(map(int,input().split()))
a = x[0]
b = x[1]
c = x[2]

if a == b+c or b == a+c or c == a+b:
  print("Yes")
else: 
  print("No")

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))
if x[0]+x[1] == x[2] or x[1]+x[2] = x[0] or x[0]+x[2] == x[1]:
  print("YES")
else:
  print("NO")
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
 
if n>k:
    p = k*x + (n-k)*y
else:
    p = n*x
print(p)

Buggy submission (verdict: Runtime Error):
input = list(map(int,input().split()))
print(int(input[1]*input[2] + (input[0]-input[1])*input[3]))
Problem p02658 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(int(input()))
ans=1
if 0 in a:
  print(0)
else:
  for i in range(n):
    ans*=a[i]
    if ans>10**18:
      print(-1)
      exit()
  print(ans)
Problem p02681 (python)

Fixed submission:
import copy
s=list(input())
t=list(input())

if len(s)==len(t)-1 and t[:len(s)]==s:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=list(input())
t=list(input())
if s[0:-1]==t[0:-2] and len(s)+1==len(t)　and t[-1].islower()==True:
  print('Yes')
  
else:
  print('No')
Problem p02700 (python)

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

while a>0 and c>0:
  c -= b
  a -= d
  
  
if c<=0:
  print("Yes")
  
else:
  print("No")

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

while a>0 and c>0:
  c -= b
  a -= d
  
  

if a>>o:
  print("Yes")
  
else:
  print("No")

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

while a>0 and c>0:
  c -= b
  a -= d
  
  

if a>o:
  print("Yes")
  
else:
  print("No")

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

while a>0 and c>0:
  a -= d
  c -= b
  

if a>o:
  print("Yes")
  
else:
  print("No")
Problem p02705 (python)

Fixed submission:
from math import pi

r = int(input())

print(2*r*pi)

Buggy submission (verdict: Runtime Error):
from math import pi

r = input()

print(2*r*pi)

Buggy submission (verdict: Runtime Error):
import math

R = input()

print(R*R*math.pi)

Buggy submission (verdict: Runtime Error):
from math import pi

R = input()

print(R*R*pi)
Problem p02706 (python)

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

hwdsum=0
k=0
while k<= m-1:
  hwdsum += a[k]
  k+=1
  
if n-hwdsum>=0:
  print(str(n-hwdsum))
  
else:
  print(str(-1))

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

hwdsum=0
k=0
while k<= m-1:
  sum += a[k]
  
if n-sum>=0:
  print(str(sum))
  
else:
  print(-1)
Problem p02713 (python)

Fixed submission:
from math import gcd
k=int(input())
cnt=0
for i in range(1,k+1):
  for p in range(1,k+1):
    for q in range(1,k+1):
      gcd1=gcd(i,p)
      
      cnt+=gcd(gcd1,q)

      
print(cnt)

Buggy submission (verdict: Runtime Error):
from math import gcd
k=int(input())
cnt=0
for i in range(k):
  for p in range(k):
    for q in range(k):
      cnt+=gcd(i,p,q)
      
print(cnt)
Problem p02780 (python)

Fixed submission:
n,k= map(int, input().split())
p = list(map(int, input().split()))
ans = sum(p[:k])
q = [ans]
for i in range(k,n):
  ans = ans+p[i]-p[i-k]
  q.append(ans)
print((max(q)+k)/2)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=list(int(input()))
maxy=0
for i in range(n-k):
  for q in range(k):
    temp+=p[i+q]
  if temp>maxy:
    maxy=temp
    
print(maxy/2)
Problem p02813 (python)

Fixed submission:
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
 
from itertools import permutations as per
tuples = per(range(1, N+1))
 
a = 0
b = 0
for i, t in enumerate(tuples):
    if t == P:
        a = i
    if t == Q:
        b = i
print(abs(a - b))

Buggy submission (verdict: Runtime Error):
n=int(input())
p=list(map(int,input(),split()))
q=list(map(int,input(),split()))
from itertools import permutations
list=list(permutations(range(1,n+1)))
ans=abs(list.index(p)-list.index(q))
Problem p02922 (python)

Fixed submission:
a,b=map(int,input().split())
c=(b-1)/(a-1)
if c-int(c)==0:
  print(int(c))

else:
  print(int(c)+1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=(b-1)//(a-1)
if c-int(c)=0:
  print(str(c))
  
else:
  print(c+1)
Problem p02947 (python)

Fixed submission:
n = int(input())

words = {}
anagrams = 0

for i in range(n):
    word = "".join(sorted(input()))
    if word not in words:
        words[word] = 1
    else:
        anagrams += words[word]
        words[word] += 1

print(anagrams)

Buggy submission (verdict: Runtime Error):
n=int(inpput())
list=[input() for i in range(n)]
lists=[]
for i in list:
  lists.append(''.join(sorted(i)))
  
print(len(lists)-len(set(lists)))
Problem p03001 (python)

Fixed submission:
w,h,x,y=map(int,input().split())
area=w*h/2
if x==w/2 and y==h/2:
  print(area, '1')
else:
  print(area, '0')

Buggy submission (verdict: Runtime Error):
w,h,x,y=map(int,input()split())
area=w*h/2
if x==w/2 and y==h/2:
  print(area, '1')
else:
  print(area, '0')
Problem p03149 (python)

Fixed submission:
n1, n2, n3, n4=map(int,input().split())
n=[]
n.append(n1)
n.append(n2)
n.append(n3)
n.append(n4)
if 1 in n and 7 in n and 9 in n and 4 in n:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n1, n2, n3, n4=map(int,input().split())
n=[]
n.append(n1, n2, n3, n4)
if 1, ,7 ,9, 4 in n:
  print('YES')
else:
  print('NO')
Problem p03282 (python)

Fixed submission:
import sys
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]!="1":
        print(s[i])
        sys.exit()
    if s[i]=="1" and i+1==k:
        print(1)
        sys.exit()

Buggy submission (verdict: Runtime Error):
s=list(input())
k=int(input())
mi=5*(10**14)
i=0
while k>=0:
  k-=s[i]*mi
  i+=1
print(s[i])

Buggy submission (verdict: Runtime Error):
s=list(input())
k=int(input())
ss=[]
t=5*(10**15)
for i in range(len(s)):
               ss.append(int(s[i]))
for i in range(len(s)):
  k-=ss[i]**t
  if k<ss[i+1]:
    print(ss[i+1])
    break
  elif k==0:
    print(ss[i])
    break

Buggy submission (verdict: Runtime Error):
s=list(input())
k=int(input())
ss=[]
for i in range(len(s)):
               ss.append(int(s[i]))
for i in range(len(s)):
  k-=ss[i]*5*(10**15)
  if k<ss[i+1]:
    break
    
print(s[i+1])

Buggy submission (verdict: Runtime Error):
s=list(int(input()))
k=int(input())
for i in range(len(s)):
  k-=s[i]*5(10**15)
  if k<s[i+1]:
    break
    
print(s[i+1])
Problem p03289 (python)

Fixed submission:
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True and t[-1]!='C':
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')

Buggy submission (verdict: Runtime Error):
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True and t[len(s-1)]!='C':
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')

Buggy submission (verdict: Runtime Error):
import copy
s=list(input())
if s[0]=='A' and 'C' in s[2:len(s)] :
  t=copy.copy(s)
  s.remove('A')
  s.remove('C')
  result=''.join(s)
  if len(s)==len(t)-2 and result.islower()==True and t[s-1]!='C':
    print('AC')
  else:
    print('WA')
    
else:
  print('WA')
Problem p03325 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(n):
  while a[i]%2==0:
    a[i]=a[i]/2
    cnt+=1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(n):
  while a[i]%2=0:
    a[i]=a[i]/2
    cnt+=1
    
print(cnt)
Problem p03427 (python)

Fixed submission:
N = input()
ans = 0

if N[1:] == "9" * (len(N) - 1):
    ans = int(N[0]) + (9 * (len(N) - 1))
else:
    ans = int(N[0]) + 9 * (len(N) - 1) - 1

print(ans)

Buggy submission (verdict: Runtime Error):
n=list(input())
n_list=[int(i) for i in n]
if n_list[0]!=1 and set(n_list)!=[9]:
  ans=9*(len(n_list)-1)+n_list[0]-1
  print(ans)
elif n_list[0]!=1 and set(n_list)==[9]:
  ans=len(n_list)*9
  print(ans)
elif n_list[0]+n_list[1]<=9:
  ans=(len(n_list)-1)*9
  print(ans)
else:
  ans=n_list[0]+n_list[1]-1+9*(len(n_list)-2)
  print(ans)

Buggy submission (verdict: Runtime Error):
n=list(input())
n_list=[int(i) for i in n]
if n_list[0]!=1 and set(n_list)!=[9]:
  ans=9*(len(n_list)-1)+n_list[0]-1
  print(ans)
elif n_list[0]!=1 and set(n_list)==[9]:
  print(9*len(n_list))
elif n_list[0]+n_list[1]<=9:
  ans=(len(n_list)-1)*9
  print(ans)
else:
  ans=n_list[0]+n_list[1]-1+9*(len(n_list)-2)
  print(ans)

Buggy submission (verdict: Runtime Error):
n=list(input())
n_list=[int(i) for i in n]
if n_list[0]!=1 and set(n_list)!=[9]:
  ans=9*(len(n_list)-1)+n_list[0]-1
  print(ans)
elif n_list[0]!=1 and set(n_list)==[9]:
  print(9*len(n_list))
elif n_list[0]+n_list[1]<=9:
  ans=(len(n_list)-1)*9
else:
  ans=n_list[0]+n_list[1]-1+9*(len(n_list)-2)
Problem p03434 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort() 
alice_sum=0
bob_sum=0
if len(a)%2==0:
  for i in range(0,n,2):
    bob_sum+=a[i]
  for l in range(1,n,2):
    alice_sum+=a[l]
else:
  for i in range(0,n,2):
    alice_sum+=a[i]
  for k in range(1,n,2):
    bob_sum+=a[k]
    
print(alice_sum-bob_sum)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort() 
alice_sum=0
bob_sum=0
if len(a)%2==0:
  for i in range(,n,2):
    bob_sum+=a[i]
  for l in range(1,n,2):
    alice_sum+=a[i]
else:
  for i in range(,n,2):
    alice_sum+=a[i]
  for k in range(1,n,2):
    bob_sum+=a[i]
    
print(alice_sum-bob_sum)
Problem p03456 (python)

Fixed submission:
from math import sqrt
a,b=map(int,input().split())
B=len(str(b))
A=(10**B)*a
sq=A+b
if sqrt(sq)==int(sqrt(sq)):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
from math import sqrt
a,b=map(int,input().split())
A={10**len(str(b))}*a
sq=A+b
if sqrt(sq)==int(sqrt(sq)):
  print('Yes')
else:
  print('No')
Problem p03471 (python)

Fixed submission:
n,y=map(int,input().split())
if y>10000*n:
  print('-1 -1 -1')
else:
  for p in range(n+1):
    for q in range(n-p+1):
      if 10000*p+5000*q+1000*(n-p-q)==y:
        print(p,q,n-p-q)
        exit()
  print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
n,y=map(int,input().split())
if y>10000*n:
  print('-1 -1 -1')
else:
  for p in range(n+1):
    for q in range(n-p+1):
      if 10000*p+5000*q+1000*(n-p-q)==y:
        print(p,q,r)
        exit()
  print('-1 -1 -1')
Problem p03478 (python)

Fixed submission:
n,a,b=map(int,input().split())
cnt=0
for i in range(n+1):
  n_list=list(str(i))
  n_listy=[int(s) for s in n_list]
  if sum(n_listy)>=a and sum(n_listy)<=b:
    cnt+=i
    
print(cnt)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
cnt=0
for i in range(n):
  n_list=list(int(i))
  if sum(n_list)>=a and sum(n_list)<=b:
    cnt+=i
print(cnt)
Problem p03485 (python)

Fixed submission:
import math
a,b=map(int,input().split())
x=(a+b)/2
print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math
a,b=int(input().split())
x=a*b/2
print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math
a,b=int(input())
x=a*b/2
print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math
a,b=int(innput())
x=a*b/2
print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math
x=a*b/2
print(math.ceil(x))
Problem p03493 (python)

Fixed submission:
s=list(input())
from collections import Counter
s_count=Counter(s)
print(s_count['1'])

Buggy submission (verdict: Runtime Error):
s=list(input())
from collections import Counter
s_count=s.Counter()
print(s_count['1'])
Problem p03557 (python)

Fixed submission:
import bisect
n= int(input())
a = list(map(int,input().split()))
a.sort()
b = list(map(int,input().split()))
b.sort()
c = list(map(int,input().split()))
c.sort()

ans = 0
for y in b:
    x = bisect.bisect_left(a, y)#挿入点はどの同じ値よりも左
    z = bisect.bisect_right(c, y) #挿入点はどの同じ値より右
    ans += x * (len(c) - z)#b<a * b > cの組み合わせ
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
abc=[list(map(int,input().split())) for i in range(3)]
sum=0
for _ in range(n):
  abc[1].append(abc[0][i])
  abc[1].sort()
  abc[2].sort()
  p=abc[1].index(abc[0][i])
  for k in range(p+1,n):
    abc[2].append(a[1][k])
    q=abc[2].index(abc[1][k])
    sum+=n-q-1
    abc[1].remove(abc[0][i])
    abc[2].remove(a[1][k])
print(sum)
Problem p03672 (python)

Fixed submission:
s=list(input())
from copy import copy
t=s.copy()

for i in range(len(t)):
  p=int(len(s)/2)
  if len(s)%2==0 and s[:p]==s[p:] and len(s)!=len(t):
    print(len(s))
    exit()
  else:
    s.pop(-1)

Buggy submission (verdict: Runtime Error):
s=list(input())
from copy import copy
t=s.copy()

for i in range(len(t)):
  if len(s)%2==0 and s[:len(s)/2]==s[len(s)/2:]:
    print(len(s))
    exit()
  else:
    s.pop(-1)

Buggy submission (verdict: Runtime Error):
s=int(input())
print(len(s)/2)
Problem p03844 (python)

Fixed submission:
a,op,b=map(str,input().split())
A=int(a)
B=int(b)
if op=="+":
  print(A+B)
else:
  print(A-B)

Buggy submission (verdict: Runtime Error):
a,op,b=map(str,input().split())
A=int(a)
B=int(b)
if op="+":
  print(A+B)
else:
  print(A-B)
Problem p02639 (python)

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

if A == 0:
    print(1)
if B == 0:
    print(2)
if C == 0:
    print(3)
if D == 0:
    print(4)
if E == 0:
    print(5)

Buggy submission (verdict: Runtime Error):
x1=int(input())
x2=int(input())
x3=int(input())
x4=int(input())
x5=int(input())
if x1==0:
    print(1)
if x2==0:
    print(2)
if x3==0:
    print(3)
if x4==0:
    print(4)
if x5==0:
    print(5)

Buggy submission (verdict: Runtime Error):
x1=int(input())
x2=int(input())
x3=int(input())
x4=int(input())
x5=int(input())
if x1==0:
    print('x1')
if x2==0:
    print('x2')
if x3==0:
    print('x3')
if x4==0:
    print('x4')
if x5==0:
    print('x5')
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
print(A*B)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(a*b)
Problem p02628 (python)

Fixed submission:
N,K=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
print(sum(p[:K]))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
print(sum(p[:K]
Problem p02613 (python)

Fixed submission:
re=0
tle=0
wa=0
ac=0
ip=[]
n=int(input())
for i in range(n):
  ip.append(input())
for i in range(n):
  if ip[i]=="AC":
    ac=ac+1
  if ip[i]=="TLE":
    tle=tle+1
  if ip[i]=="WA":
    wa=wa+1
  if ip[i]=="RE":
    re=re+1
print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

Buggy submission (verdict: Runtime Error):
re=0
tle=0
wa=0
ac=0
ip=[]
n=int(input())
for i in range(n):
  ip.append(input())
for i in range(n):
  if ip[i]=="AC":
    ac=ac+1
  if ip[i]=="TLE":
    tle=tle+1
  if ip[i]=="WA":
    wa=wa+1
  if ip[i]=="RE":
    re=re+1
print("AC x "+ac)
print("WA x "+wa)
print("TLE x "+tle)
print("RE x "+re)
Problem p02600 (python)

Fixed submission:
X=int(input())
N=8-int((X-400)/200)
print(N)

Buggy submission (verdict: Runtime Error):
print(8-int((input()-400)/200))

Buggy submission (verdict: Runtime Error):
print(8-int((X-400)/200))
Problem p02641 (python)

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

if N == 0:
  print(X)
  exit()
else:
  P = list(map(int,input().split()))

  for i in range(100):
    if (X-i) not in P:
      print(X-i)
      break
    elif (X+i) not in P:
      print(X+i)
      break

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

P = a[1] - 1 

list = list(map(lambda x: x+1, list(range(b[P]))))

if a[1] == 0:
  print(a[0])
  exit()

for i in range(a[1]):
  list.remove(b[i])

num = 0

result = []

for i in range(a[1]):
  x = a[0] - b[num]
  result.append(abs(x))
  num += 1

print(min(result))
Problem p02681 (python)

Fixed submission:
S = input()
T = input()

T_plus = T[-1]
T_a = T[:-1]

print("Yes" if S==T_a else "No")

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

T_plus = T[-1]
T_a = T[:-1]

if S == T_a:
  print("Yes")
else:
  print("No")
 print("Yes" if S==T else "No")

Buggy submission (verdict: Runtime Error):
T_plus = T[-1]
T_a = T[:-1]

if S == T_a:
  print("Yes")
else:
  print("No")
Problem p02600 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
if x>=400 and x<=599:
    print(8)
    exit()
if x>=600 and x<=799:
    print(7)
    exit()
if x>=800 and x<=999:
    print(6)
    exit()
if x>=1000 and x<=1199:
    print(5)
    exit()
if x>=1200 and x<=1399:
    print(4)
    exit()
if x>=1400 and x<=1599:
    print(3)
    exit()
if x>=1600 and x<=1799:
    print(2)
    exit()
if x>=1800 and x<=1999:
	print(1)
  	exit()

Buggy submission (verdict: Runtime Error):
n=int(input())
if x>=400 and x<=599:
    print(8)
    exit()
if x>=600 and x<=799:
    print(7)
    exit()
if x>=800 and x<=999:
    print(6)
    exit()
if x>=1000 and x<=1199:
    print(5)
    exit()
if x>=1200 and x<=1399:
    print(4)
    exit()
if x>=1400 and x<=1599:
    print(3)
    exit()
if x>=1600 and x<=1799:
    print(2)
    exit()
if x>=1800 and x<=1999:
	print(1)
  	exit()
Problem p02602 (python)

Fixed submission:
n,k=map(int,input('').split())
A=list(map(int,input('').split()))
for i in range(k,n):
    if A[i]>A[i-k]:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n,k=map(int,input('').split())
A=list(map(int,input('').split()))
prev=A[k-1]*A[0]
for i in range(k,n):
    j=i-k+1
    while(A[i]*A[j]==prev and j<n):
        j+=1
        prev=A[k-1]*A[j+k-1-i]
    if A[i]*A[j]>prev:
        print('Yes')
    else:
        print('No')
    prev=A[i]*A[i-k+1]
Problem p02607 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
res = 0
for i in range(1, len(A)+1, 2):
    res += A[i] % 2
print(res)