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

Fixed submission:
n=int(input())

lst=[]
for i in range(1, n+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])

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

lst=[]
for i in range(1, N+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])

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

lst=[]
for i in range(1, N+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])
Problem p03085 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
b=input()

if b=="A":
	print("T")
if b=="T":
	print("A")
if b=="G":
	print("C")
if b=="C":
	print("G")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
b=input()

if b==A:
	print("T")
if b==T:
	print("A")
if b==G:
	print("C")
if b==C:
	print("G")
Problem p03109 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=input()

if S<="2019/04/30":
	print("Heisei")
else:
	print("TBD")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=input()

if A<="2019/04/30":
	print("Heisei")
else:
	print("TBD")
Problem p03126 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

S=set(range(1,m+1))
for i in range(n):
	K,*A=map(int,input().split())
	S&=set(A)
print(len(S))

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

S=set(range(a,m+1))
for i in range(n):
	K,*A=map(int,input().split())
	S&=set(A)
print(len(S))
Problem p03161 (python)

Fixed submission:
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

N,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[float("inf") for _ in range(N)]
dp[0]=0
for i in range(N-1):
	for j in range(1,min(K+1,N-i)):
		dp[i+j] = min(dp[i+j],dp[i]+abs(h[i+j]-h[i]))
print(dp[N - 1])

Buggy submission (verdict: Runtime Error):
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

N=int(input())
h=list(map(int,input().split()))
dp=[float("inf") for _ in range(N)]
dp[0]=0
for i in range(N-1):
	for j in range(1,min(K+1,N-i)):
		dp[i+j] = min(dp[i+j],dp[i]+abs(h[i+j]-h[i]))
print(dp[N - 1])
Problem p03238 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n=int(input())

if n==1:
	print("Hello World")
if n==2:
	a=int(input())
	b=int(input())
	print(a+b)

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n=int(input())

if n=1:
	print("Hello World")
if n=2:
	a=int(input())
	b=int(input())
	print(a+b)
Problem p03239 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,T= map(int,input().split())

c=[]
t=[]
m=10000
cnt=0
C=[list(map(int,input().split())) for _ in range(N)]

for j in range(N):
	if C[j][1]>T:
		cnt+=1
	else:
		m=min(C[j][0],m)
		

	

if cnt==N:
	print("TLE")
else:
	print(m)

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,T= map(int,input().split())

c=[]
t=[]

for _ in range(N):
	C,T=map(int,input().split())
	c.append(C)
	t.append(T)
	
for j in range(N):
	if t[j]>T:
		c[j]=1001

if min(c)=1001:
	print("TLE")

else:
	print(min(c))
Problem p03262 (python)

Fixed submission:
import numpy as np
from fractions import gcd
n,x=map(int,input().split())
xl=list(map(int,input().split()))

xl.append(x)


p=min(xl)
ans=x-p
for i in range(n+1):
    ans=gcd(xl[i]-p,ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,x=map(int,input().split())
xl=list(map(int,input().split()))

xl.append(x)

arr=np.array(xl)

p=min(arr)
arrr=arr-p
print(np.gcd.reduce(arrr))
Problem p03282 (python)

Fixed submission:
s=input()
k=int(input())
cnt=0
i=0
while s[i] =="1" and i<=len(s):
    cnt+=1
    i+=1
    if i==len(s):
        break

#print(cnt)
if k<=cnt:
    print(1)
else:
    print(s[i])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
cnt=0
i=0
while s[i] =="1" and i<=len(s):
    cnt+=1
    i+=1

#print(cnt)
if k<=cnt:
    print(1)
else:
    #if len(s)==1:
        #print(s[0])
    #else:
    print(s[i])
Problem p03393 (python)

Fixed submission:
import sys
from collections import Counter
s=input()
count=Counter(s)
alphabets=[chr(ord("a")+i) for i in range(26)]
if s=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    sys.exit()

if len(count) <26:
    for i in range(26):
        if alphabets[i] not in count:
            print(s+alphabets[i])
            sys.exit()

for i in range(25):
    if ord(s[25-i])<ord(s[24-i]):
        continue
    else:
        memo=s[24-i]
        break
lst=sorted(list("qwertyuiopasdfghjklzxcvbnm"))
for j in range(24-i):
    lst.remove(s[j])
moji=lst[lst.index(memo)+1]
print(s[:24-i]+moji)

Buggy submission (verdict: Runtime Error):
import sys
s=input()
if len(s)==26:
    if s=="zyxwvutsrqponmlkjihgfedcba":
        print(-1)
        sys.exit()
    for i in range(25):
        if ord(s[i])+1==ord(s[i+1]):
            continue
        else:
            s=s[:i]
            break
    se=set(s)
    p=sorted(list(set(s)))
    moji=[]
    alphabet=[chr(i) for i in range(97, 97+26)]
    for i in range(26):
        if alphabet[25-i] not in se:
            
            moji.append(alphabet[25-i])
    print(s+moji[len(moji)-2])
else:
    se=set(s)
    p=sorted(list(set(s)))
    alphabet=[chr(i) for i in range(97, 97+26)]
    for i in range(26):
        if alphabet[25-i] not in se:
            moji=alphabet[25-i]
    print(s+moji)
Problem p03427 (python)

Fixed submission:
x=int(input())
y=str(x)
n=len(y)

if y[1:]=="9"*(n-1):
    print(int(y[0])+9*n-9)
else:
    print(int(y[0])-1+9*n-9)

Buggy submission (verdict: Runtime Error):
x=int(input())
y=str(x)
n=len(y)
print(int(n[0])+9*n)
Problem p03474 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())
S=input().split("-")
if len(S[0])==a and len(S[1])==b:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())
A,B=input().split("-")
if len(A)==a and len(B)==b:
	print("Yes")
else:
	print("No")
Problem p03477 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,c,d=map(int,input().split())

if a+b<c+d:
	print("Right")
elif a+b>c+d:
	print("Left")
else:
	print("Balanced")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,c,d=map(int,input().split())

if a+b<c+d:
	print("Right")
elif: a+b>c+d:
	print("Left")
else:
	print("Balanced")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,c,d=input().split()

if a+b<c+d:
	print("Right")
elif: a+b>c+d:
	print("Left")
else:
	print("Balanced")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b,c,d=input().split()

if a+b<c+d:
	print("Right")
elif: a+b>c+d:
	print("Left")
else:
	print("Balanced")
Problem p03486 (python)

Fixed submission:
import sys
 
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
 
a=input()
b=input()
 
a=sorted(a)
b=sorted(b)
cnt=0
 
if a==b:
	print("No")
	sys.exit()
 
for i in range(min(len(a),len(b))):
	if a[i]<b[-(i+1)]:
		print("Yes")
		break
	
	elif a[i]==b[-(i+1)]:
		cnt+=1
		continue
		
	else:
		print("No")
		break
		
if cnt==min(len(a),len(b)) and len(a)<len(b):
	print("Yes")
	
elif cnt==min(len(a),len(b)) and len(a)>len(b):
	print("No")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

a=input()
b=input()

a=sorted(a)
b=sorted(b)

if a==b:
	print("No")
	sys.exit()

for i in range(min(len(a),len(b))):
	if a[i]<b[-(i+1)]:
		print("Yes")
		break
	
	elif a[i]==b[-(i+1)]:
		continue
		
	else:
		print("No")
		break
		
if len(a)<len(b)):
	print("Yes")
	
else:
	print("No")
Problem p03494 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

N=int(input())
A=list(map(int,input().split()))
ans=0
while all(a%2==0 for a in A):
	A=[a/2 for a in A]
	ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

N=int(input())
A=list(map(int,input().split()))
	while all(a%2==0 for a in A):
		A=[a/2 for a in A]
		ans+=1
print(ans)
Problem p03578 (python)

Fixed submission:
import heapq

n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))

heapq.heapify(d)
heapq.heapify(t)
cnt=0


if n>1 and m>1:
    for i in range(m):
        a=heapq.heappop(t)
        if len(d)>0:
            b=heapq.heappop(d)
        #print(a,b,cnt)
        while b<a and len(d)>0:
            b=heapq.heappop(d)
        if b==a:
            cnt+=1
    if cnt==m:
        print("YES")
    else:
        print("NO")

else:
    if n==1:
        if m==1 and t[0]==d[0]:
            print("YES")
        else:
            print("NO")
    else:
        if t[0] in d:
            print("YES")
        else:
            print("NO")

Buggy submission (verdict: Runtime Error):
import heapq

n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))

heapq.heapify(d)
heapq.heapify(t)
cnt=0

if n>1 and m>1:
    for i in range(m):
        a=heapq.heappop(t)
        if len(b)>0:
            b=heapq.heappop(d)
        #print(a,b,cnt)
        while b<a and len(b)>0:
            b=heapq.heappop(d)
        if b==a:
            cnt+=1
    if cnt==m:
        print("YES")
    else:
        print("NO")

else:
    if n==1:
        if m==1 and t[0]==d[0]:
            print("YES")
        else:
            print("NO")
    else:
        if t[0] in d:
            print("YES")
        else:
            print("NO")

Buggy submission (verdict: Runtime Error):
import heapq

n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))

heapq.heapify(d)
heapq.heapify(t)
cnt=0

if n>1 and m>1:
    for i in range(m):
        a=heapq.heappop(t)
        b=heapq.heappop(d)
        #print(a,b,cnt)
        while b<a:
            b=heapq.heappop(d)
        if b==a:
            cnt+=1
    if cnt==m:
        print("YES")
    else:
        print("NO")

else:
    if n==1:
        if m==1 and t[0]==d[0]:
            print("YES")
        else:
            print("NO")
    else:
        if t[0] in d:
            print("YES")
        else:
            print("NO")

Buggy submission (verdict: Runtime Error):
import heapq

n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))

heapq.heapify(d)
heapq.heapify(t)
cnt=0

if n>1 and m>1:
    for i in range(m):
        a=heapq.heappop(t)
        b=heapq.heappop(d)
        #print(a,b,cnt)
        while b<a:
            b=heapq.heappop(d)
        if b==a:
            cnt+=1
    if cnt==m:
        print("YES")
    else:
        print("NO")

else:
    if n==1:
        print("NO")
    else:
        if t[0] in d:
            print("YES")
        else:
            print("NO")

Buggy submission (verdict: Runtime Error):
import heapq

n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))

heapq.heapify(d)
heapq.heapify(t)
cnt=0

for i in range(m):
    a=heapq.heappop(t)
    b=heapq.heappop(d)
    #print(a,b,cnt)
    while b<a:
        b=heapq.heappop(d)
    if b==a:
        cnt+=1
        
    
if cnt==m:
    print("YES")
else:
    print("NO")
Problem p03719 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

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

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

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

a,b,c=int(input())

if (c-a)>=0 and b-c>=0:
	print("Yes")
else:
	print("No")
Problem p03729 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

s1,s2,s3=map(str,input().split())

if s1[-1]==s2[0] and s2[-1]==s3[0]:
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

s1,s2,s3=map(str,input().split())

if s1[-1]==s2[0] and s2[-1]=s3[0]:
	print("YES")
else:
	print("NO")
Problem p03777 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=input().split()

if a==b:
	print("H")
else:
	print("D")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=input().split("")

if a==b:
	print("H")
else:
	print("D")
Problem p03796 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
    
n=int(input())
a=1
for i in range(1,n+1):
	a=a*i%1000000007
	
print(a)

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
import math

print(math.factorial(n)%(10**9+7))
Problem p03838 (python)

Fixed submission:
x,y=map(int,input().split())
cnt=0
cnt+=y-x
cnt1=1
cnt1+=y+x
cnt2=1
cnt2+=-y-x
cnt3=2
cnt3+=-y+x
a=[cnt,cnt1,cnt2,cnt3]
for i in range(4):
    if a[i]<0:
      a[i]=10000000000000000
print(min(a))

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
cnt=0
cnt+=y-x
cnt1=1
cnt1+=y+x
cnt2=1
cnt2+=-y-x
cnt3=2
cnt3+=-y+x
a=[cnt,cnt1,cnt2,cnt3]
foe i in a:
    if i<0:
        i=10**10
print(min(cnt,cnt1,cnt2,cnt3))
Problem p04011 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

	
print(N*X-(max((N-K),0)*(X-Y)))

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
for _ in range(4):
	N,K,X,Y=int(input())

	
print(N*X-(max((N-K),0)*(X-Y)))

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

	
print(N*X-(max((N-K),0)*(X-Y))

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
for _ in range(4):
	N,K,X,Y=int(input())
	
print(N*X-(max((N-K),0)*(X-Y))
Problem p04043 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=map(int,input().split())

s=sorted(S)

if s==[5,5,7]:
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=map(int,input().split())

s=sorted(S)

if s==5,5,7:
	print("YES")
else:
	print("NO")
Problem p04044 (python)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,L=map(int,input().split())

list=sorted([input() for i in range(N)])
print(*list,sep="")

Buggy submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,L=map(int,input().split())

list=soeted([input() for i in range(N)])
print(*list,sep="")
Problem p02641 (python)

Fixed submission:
def main():
    x, n = (int(x) for x in input().split())
    p = [int(x) for x in input().split()]

    if x not in p:
        print(x)
    else:
        for i in range(1, 200):
            if x - i not in p:
                print(x - i)
                break
            if x + i not in p:
                print(x + i)
                break

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

X, N = (int(x) for x in input().split())
if N != 0:
  p = [int(x) for x in input().split()]
else:
  print(X)
  sys.exit()
i = 0
ans = X
flag = False
while True:
  if X + i in p: continue
  ans = X + i
  flag = True
  if X - i in p: continue
  ans = X - i
  flag = True
  if flag: break
  i += 1
pritn(ans)
Problem p02747 (python)

Fixed submission:
from sys import stdin

s = stdin.readline().rstrip()

ans = "Yes"
if len(s)%2 != 0:
    ans = "No"
else:
    for i in range(0, len(s), 2):
        if s[i] + s[i+1] != "hi":
            ans = "No"
print(ans)

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

s = stdin.readline().rstrip()

ans = "Yes"
for i in range(0, 9, 2):
    if s[i] + s[i+1] != "hi":
        ans = "No"
        break

print(ans)

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

s = stdin.readline().rstrip()

ans = "Yes"
for i in range(0, 11, 2):
    if s[i] + s[i+1] != "hi":
        ans = "No"
        break

print(ans)

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

s = stdin.readline().rstrip()

ans = "Yes"
for i in range(0, len(s), 2):
    if s[i] + s[i+1] != "hi":
        ans = "No"

print(ans)
Problem p02760 (python)

Fixed submission:
bingo = [input().split() for _ in range(3)]

n = int(input())

nums = [input() for _ in range(n)]

check = [[] for _ in range(3)]

for i in range(3):
    for j in range(3):
        if bingo[i][j] in nums:
            check[i].append(True)
        else:
            check[i].append(False)

ANS = "No"

for i in range(3):
    if (check[i][0]) and (check[i][1]) and (check[i][2]):
        ANS = "Yes"
for i in range(3):
    if (check[0][i]) and (check[1][i]) and (check[2][i]):
        ANS = "Yes"
if (check[0][0]) and (check[1][1]) and (check[2][2]):
    ANS = "Yes"
if (check[0][2]) and (check[1][1]) and (check[2][0]):
    ANS = "Yes"

print(ANS)

Buggy submission (verdict: Runtime Error):
bingo = [input().split() for _ in range(3)]

n = int(input())

nums = [[] for _ in range(3)]

check = list()

for i in range(3):
    for j in range(3):
        check[i].append(False)
        if bingo[i][j] in nums:
            check[i][j] = True

ANS = "No"

for i in range(3):
    if (check[i][0]) and (check[i][1]) and (check[i][2]):
        ANS = "Yes"
for i in range(3):
    if (check[0][i]) and (check[1][i]) and (check[2][i]):
        ANS = "Yes"
if (check[0][0]) and (check[1][1]) and (check[2][2]):
    ANS = "Yes"
if (check[0][2]) and (check[1][1]) and (check[2][0]):
    ANS = "Yes"

print(ANS)
Problem p02767 (python)

Fixed submission:
N = int(input())
 
X = list(map(int, input().split()))
 
a = round((sum(X) / N), 3)
integer = int(a)
f = a - integer
 
if f < 0.5:
    P = integer
else:
    P = integer + 1
 
total = 0
for i in X:
    total += (i - P) ** 2
 
print(total)

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

X = list(map(int, input().split()))

a = round((sum(X) / N), 3)
integer = int(a)
f = a - i

if f < 0.5:
    P = integer
else:
    P = integer + 1

total = 0
for i in X:
    total += (i - P) ** 2

print(total)

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

X = list(map(int, input().split()))

a = sum(X) / N
integer = int(a)
f = a - i

if f < 0.5:
    P = integer
else:
    P = integer + 1

total = 0
for i in X:
    total += (i - P) ** 2

print(total)
Problem p02802 (python)

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

eva = [[0, 0] for _ in range(n)]

ac = 0
penalty = 0

for i in range(m):
    q, s = input().split()
    if eva[int(q) - 1][1] == 0:
        if s == "WA":
            eva[int(q) - 1][0] += 1
        else:
            eva[int(q) - 1][1] += 1
            ac += 1
            penalty += eva[int(q) - 1][0]
    else:
        pass

print(ac, penalty)

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

eva = {}

ac = 0
wa = 0

for i in range(m):
    q, s = input().split()
    if eva[q] == "AC":
        pass
    else:
        if s == "AC":
            ac += 1
            eva[q] = "AC"
        else:
            wa += 1

print(ac, wa)

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

eva = [[0] for _ in range(n)]

ac = 0
wa = 0

for i in range(m):
    a = input().split()
    q = int(a[0])
    s = a[1]
    if "AC" in eva[q]:
        pass
    else:
        if s == "AC":
            ac += 1
            eva[q].append("AC")
        else:
            wa += 1
            eva[q] += 1

print(ac, wa)
Problem p02811 (python)

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

print("Yes" if 500*k >= x else "No")

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

print("Yes" if 500*k >= x else "No")
Problem p02923 (python)

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]

m = 0
count = 0
for i in range(n):
    if i == n - 1:
        if m < count:
            m = count
    else:
        if h[i] >= h[i + 1]:
            count += 1
        else:
            if m < count:
                m = count
            count = 0

print(m)

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

n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]

m = 0
count = 0
for i in range(n):
    if (i == n - 1) and (m < count):
        m = count
    else:
        if h[i] >= h[i + 1]:
            count += 1
        else:
            if m < count:
                m = count
            count = 0

print(m)
Problem p02995 (python)

Fixed submission:
from sys import stdin
from fractions import gcd

def lcm(x, y):
    return (x * y) // gcd(x, y)

a, b, c, d = (int(x) for x in stdin.readline().rstrip().split())

lcm = lcm(c, d)

total = b - (a - 1)
mc = b // c - (a - 1) // c
md = b // d - (a - 1) // d
mlcm = b // lcm - (a - 1) // lcm

print(total - (mc + md - mlcm))

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

def lcm(x, y):
    return (x * y) // gcd(x, y)

a, b, c, d = (int(x) for x in stdin.readline().rstrip().split())

lcm = lcm(c, d)

total = b - (a - 1)
mc = b // c - (a - 1) // c
md = b // d - (a - 1) // d
mlcm = b // e - (a - 1) // e

print(total - (mc + md - mlcm))

Buggy submission (verdict: Runtime Error):
import sys
from fractions import gcd

def lcm(x, y):
    return (x * y) // gcd(x, y)

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

length = b - a + 1
lc = a % c
rc = b % c
ld = a % d
rd = b % d
lcm = lcm(c, d)

ans = length
if (b < c) and (b < d):
    print(ans)
    sys.exit()

if length == c:
    ans -= length//c
if length == d:
    ans -= lenght//d

if length > c:
    temp = length//c
    if lc + rc >= c:
        temp += 1
    ans -= temp

if length > d:
    temp = length//d
    if ld + rd >= d:
        temp += 1
    ans -= temp

if length < c and ((lc > rc) or lc == 0 or rc == 0):
    ans -= 1
if length < d and ((ld > rd) or ld == 0 or rd == 0):
    ans -= 1

i = 1
while i * lcm <= b:
    if a <= i * lcm <= b:
        ans += 1
    i += 1

print(ans)