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

Fixed submission:
w,h,x,y=map(int,input().split())

if w/2==x and h/2==y:
    ans=1

else:
    ans=0


print(w*h/2,ans)

Buggy submission (verdict: Runtime Error):
w,h,x,y=map(int,input().split())

elif w/2==x and h/2==y:
    ans=1

else:
    ans=0


print(w*h/2,ans)
Problem p03044 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

n=int(input())

edge=[[] for _ in range(n+1)]

for i in range(n-1):
    v1,v2,w=map(int,input().split())
    if w%2!=0:
        edge[v1].append((v2,-1))
        edge[v2].append((v1,-1))
    else:
        edge[v1].append((v2,1))
        edge[v2].append((v1,1))

color=[None]*(n+1)        
def set_color(x,col):
    color[x]=col
    
    for i,j in edge[x]:
        if color[i] is None:
            set_color(i,j*col)
set_color(1,1)

for x in color[1:]:
    print((x+1)//2)

Buggy submission (verdict: Runtime Error):
n=int(input())
edge=[[]for i in range(n+1)]
for i in range(n-1):
    a,b,c=map(int,input().split())
    if c%2==0:
        edge[a].append((b,1))
        edge[b].append((a,1))
    else:
        edge[a].append((b,-1))
        edge[b].append((a,-1))
        

ans=[None]*(n+1)
check=[None]*(n+1)
check[1]=1


for i in range(1,n+1):
    for j in edge[i]:
        if ans[j[0]] is None:
            ans[j[0]]=check[i]*j[1]
            check[j[0]]=check[i]*j[1]
            
for i in ans[1:]:
    print((i+1)//2)
Problem p03078 (python)

Fixed submission:
import heapq
x,y,z,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

li=[]
push=heapq.heappush
pop=heapq.heappop

push(li,(-a[0]-b[0]-c[0],0,0,0))
ans=[]
used=set()

for _ in range(k):
    value,i,j,l=pop(li)
    ans.append(-value)
    if i<x-1 and (i+1,j,l) not in used:
        push(li,(-a[i+1]-b[j]-c[l],i+1,j,l))
        used.add((i+1,j,l))
    if j<y-1 and (i,j+1,l) not in used:
        push(li,(-a[i]-b[j+1]-c[l],i,j+1,l))
        used.add((i,j+1,l))
    if l<z-1 and (i,j,l+1) not in used:
        push(li,(-a[i]-b[j]-c[l+1],i,j,l+1))
        used.add((i,j,l+1))
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
import heapq
x,y,z,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

li=[]
push=heapq.heappush
pop=heapq.heappop

push(li,(-a[0]-b[0]-c[0],0,0,0))
ans=[]
used=set()

for _ in range(k):
    value,i,j,l=pop(li)
    ans.append(-value)
    if i<x-1 and (i+1,j,l) not in used:
        push(li,(-a[i+1]-b[j]-c[l],i+1,j,l))
        used.add((i+1,j,l))
    if j<y-1 and (i,j+1,l) not in used:
        push(li,(-a[i]-b[j+1]-c[l],i,j+1,l))
        used.add((i,j+1,l))
    if k<z-1 and (i,j,l+1) not in used:
        push(li,(-a[i]-b[j]-c[l+1],i,j,l+1))
        used.add((i,j,l+1))
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
import heapq
x,y,z,k=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

li=[]
push=heapq.heappush
pop=heapq.heappop

push(li,(-a[0]-b[0]-c[0],0,0,0))
ans=[]
used=set()

for _ in range(k):
    value,i,j,l=pop(li)
    ans.append(-value)
    if i<x-1 and (i+1,j,l) not in used:
        push(li,(-a[i+1]-b[j]-c[l],i+i,j,l))
        used.add((i+1,j,l))
    if j<y-1 and (i,j+1,l) not in used:
        push(li,(-a[i]-b[j+1]-c[l],i,j+1,l))
        used.add((i,j+1,l))
    if k<z-1 and (i,j,l+1) not in used:
        push(li,(-a[i]-b[j]-c[l+1],i,j,l+1))
        used.add((i,j,l+1))
for i in ans:
    print(i)
Problem p03085 (python)

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

Buggy submission (verdict: Runtime Error):
b = input()
if b = 'A':
    print('T')
elif b = 'C':
    print('G')
elif b = 'G':
    print('C')
else:
    print('A')
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
l = []
for i in range(1, max(a,b)+1):
    if a % i == 0 and b % i == 0:
        l.append(i)
print(l[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
l = []
for i in range(1, max(a,b)):
    if a % i == 0 and b % i == 0:
        l.append(i)
print(l[-k])
Problem p03239 (python)

Fixed submission:
n, T = map(int,input().split())
cost = 10000
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        cost = min(cost, c)
if cost == 10000:
    print('TLE')
else:
    print(cost)

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
ans = float('inf')
for i in range(n):
    c, t2 = map(int, input().split())
    if t2 <= t:
        ans = min(ans, c)
print('TLE' if ans = float('inf') else c)
Problem p03251 (python)

Fixed submission:
n, m, x, y = map(int, input().split())
xx = [int(i) for i in input().split()]
yy = [int(i) for i in input().split()]

ans = 'No War' if max(max(xx), x) < min(min(yy), y) else 'War'
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x, y = map(int, input().split())
xx = [int(i) for i in input().split()]
yy = [int(i) for i in input().split()]

ans = 'No War' if max(xx, x) < min(yy, y) else 'War'
print(ans)
Problem p03262 (python)

Fixed submission:
import fractions
import numpy as np
n,x=map(int,input().split())
li=np.array(input().split(),dtype=np.int64)

li=abs(li-x)

if n==1:
    print(li[0])
else:
    ans=0
    for i in li:
        ans=fractions.gcd(ans,i)
    print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
import numpy as np
n,x=map(int,input().split())
li=np.array(input().split(),dtype=np.int64)

li=abs(li-x)

if len(li)==1:
    print(li[0])
else:
    mini=fractions.gcd(li[0],li[1])
    for i in range(2,n):
        mini=math.gcd(mini,li[i])
    print(mini)

Buggy submission (verdict: Runtime Error):
import fractions
import numpy as np
n,x=map(int,input().split())
li=np.array(input().split(),dtype=np.int64)

li=abs(li-x)

if len(li)==1:
    print(li[0])
else:
    mini=fractions.gcd(li[0],li[1])
    for i in range(2,n):
        gc=math.gcd(mini,li[i])
        mini=gc
    print(mini)

Buggy submission (verdict: Runtime Error):
import fractions
import numpy as np
n,x=map(int,input().split())
li=np.array(input().split(),dtype=np.int64)

li=abs(li-x)

if len(li)==1:
    print(li[0])
else:
    mini=fractions.gcd(li[0],li[1])
    for i in range(2,n):
        gc=math.gcd(mini,li[i])
        mini=min(mini,gc)
    print(mini)

Buggy submission (verdict: Runtime Error):
import fractions
import numpy as np
n,x=map(int,input().split())
li=np.array(input().split(),dtype=np.int64)

li=abs(li-x)

if len(li)==1:
    print(li[0])
else:
    mini=fractions.gcd(li[0],li[1])
    for i in range(1,n):
        gc=math.gcd(mini,li[i])
        mini=min(mini,gc)
    print(mini)

Buggy submission (verdict: Runtime Error):
import fractions
import numpy as np
n,x=map(int,input().split())
li=np.array(input().split(),dtype=np.int64)

li=abs(li-x)

if len(li)==1:
    print(li[0])
else:
    mini=fractions.gcd(li[0],li[i+1])
    for i in range(1,n):
        gc=math.gcd(mini,li[i])
        mini=min(mini,gc)
    print(mini)

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
n,x=map(int,input().split())
li=np.array(input().split(),dtype=np.int64)

li=abs(li-x)

if len(li)==1:
    print(li[0])
else:
    mini=math.gcd(li[0],li[i+1])
    for i in range(1,n):
        gc=math.gcd(mini,li[i])
        mini=min(mini,gc)
    print(mini)
Problem p03352 (python)

Fixed submission:
x=int(input())
li=[]
for i in range(1,1000):
    for j in range(2,11):
        if i**j<=x:
            li.append(i**j)
li=set(li)
li=sorted(list(li))

print(max(li))

Buggy submission (verdict: Runtime Error):
x=int(input())
li=[]
for i in range(1,1001):
    for j in range(2,11):
        if i**j<=1000:
            li.append(i**j)
li=set(li)
li=sorted(list(li))

i=0
while li[i] <=x:
    i+=1
print(li[i-1])
Problem p03359 (python)

Fixed submission:
a,b = map(int, input().split())
print(a if a<=b else a-1)

Buggy submission (verdict: Runtime Error):
a,b = map(int, iput().split())
print(a if a<=b else a-1)
Problem p03361 (python)

Fixed submission:
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dx=[0,1,0,-1]
dy=[1,0,-1,0]
ans=True
for i in range(h):
    for j in range(w):
        if s[i][j]=='#':
            ans=False
            for k in range(4):
                nx = i+dx[k]
                ny = j+dy[k]
                if nx>=0 and nx <h and ny>=0 and ny<w and s[nx][ny]=='#':
                    ans = True
                    break
            if ans ==False:
                print('No')
                exit()
if ans:
    print('Yes')

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dx=[0,1,0,-1]
dy=[1,0,-1,0]
for i in range(h):
    for j in range(w):
        if s[i][j]=='#':
            ans=False
            for k in range(4):
                nx = i+dx[k]
                ny = j+dy[k]
                if nx>=0 and nx <h and ny>=0 and ny<w and s[nx][ny]=='#':
                    ans = True
                    break
            if ans ==False:
                print('No')
                exit()
if ans:
    print('Yes')
Problem p03377 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,w = map(int,input().split())
print('YES' if a <= w <= a+b else:'NO')
Problem p03378 (python)

Fixed submission:
n, m, x = map(int, input().split())
a = [int(i) for i in input().split()]

l = sum(1 if i < x else 0 for i in a)
r = m -l

print(min(l,r))

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
a = [int(i) for i in input().split()]

l = sum(1 if i < x else 0 for i in A)
r = m -l

print(min(l,r))

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
a = [int(i) for i in input().split()]

l = sum(1 if x < X else 0 for x in A)
r = m -l

print(min(l,r))
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
li1 = range(a,a+k)
li2 = range(b-k+1,b+1)
se1=set(li1)
se2=set(li2)
se=sorted(se1|se2)
for i in se:
    if a<=i<=b:
        print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
r = list(range(a,b+1))
mm = r[:k]
MM = r[-k:]
mM = mm + MM
mM = sorted(list(set(mM)))
for i in range(len(mM)):
    print(mM[i])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
r = list(range(a,b+1))
mm = r[:k]
MM = r[-k:]
mM = mm + MM
mM = sorted(list(set(mM)))
for i in range(len(mM)):
    print(mM[i])
Problem p03408 (python)

Fixed submission:
n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]

dic={}
for i in s:
    if i in dic:
        dic[i]+=1
    else:
        dic[i]=1

for i in t:
    if i in dic:
        dic[i]-=1
ma=max(dic.values())
print(max(ma , 0))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]

dic={}
for i in s:
    if i in dic:
        dic[i]+=1
    else:
        dic[i]=1

for i in t:
    if i in dic:
        dic[i]-=1
print(max(dic.values(),0))
Problem p03425 (python)

Fixed submission:
n=int(input())
s=[input() for i in range(n)]

dic={}
for i in s:
    if i[0]=='M' or i[0]=='A' or i[0]=='R' or i[0]=='C' or i[0]=='H':
        if i[0] in dic:
            dic[i[0]]+=1
        else:
            dic[i[0]]=1
if len(dic)<3:
    ans=0
else:
    if len(dic)==3:
        ans = 1
        for i in dic.values():
            ans *=i
    elif len(dic)==4:
        li4 = []
        for i in dic.values():
            li4.append(i)
        ans = li4[0]*li4[1]*li4[2]+li4[0]*li4[1]*li4[3]+li4[0]*li4[2]*li4[3]+li4[1]*li4[2]*li4[3]
    else:
        li5 = []
        for i in dic.values():
            li5.append(i)
        ans =li5[0]*li5[1]*li5[2]+li5[0]*li5[1]*li5[3]+li5[0]*li5[1]*li5[4]+li5[0]*li5[2]*li5[3]+li5[0]*li5[2]*li5[4]+li5[0]*li5[3]*li5[4]+li5[1]*li5[2]*li5[3]+li5[1]*li5[2]*li5[4]+li5[1]*li5[3]*li5[4]+li5[2]*li5[3]*li5[4]
print(ans)

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

dic={}
for i in s:
    if i[0]=='M' or i[0]=='A' or i[0]=='R' or i[0]=='C' or i[0]=='H':
        if i[0] in dic:
            dic[i[0]]+=1
        else:
            dic[i[0]]=1
if len(dic)<3:
    ans=0
else:
    if len(dic)==3:
        ans = 1
        for i in dic.values():
            ans *=i
    elif len(dic)==4:
        li4 = []
        for i in dic.values():
            li4.append(i)
        ans = li4[0]*li4[1]*li4[2]+li4[0]*li4[1]*li4[3]+li4[0]*li4[2]*li4[3]+li4[1]*li4[2]*li4[3]
    else:
        li4 = []
        for i in dic.values():
            li5.append(i)
        ans =li5[0]*li5[1]*li5[2]+li5[0]*li5[1]*li5[3]+li5[0]*li5[1]*li5[4]+li5[0]*li5[2]*li5[3]+li5[0]*li5[2]*li5[4]+li5[0]*li5[3]*li5[4]+li5[1]*li5[2]*li5[3]+li5[1]*li5[2]*li5[4]+li5[1]*li5[3]*li5[4]+li5[2]*li5[3]*li5[4]
print(ans)

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

dic={}
for i in s:
    if i[0]=='M' or i[0]=='A' or i[0]=='R' or i[0]=='C' or i[0]=='H':
        if i[0] in dic:
            dic[i[0]]+=1
        else:
            dic[i[0]]=1
if len(dic)<3:
    ans=0
else:
    if len(dic)==3:
        ans = 1
        for i in dic.values():
            ans *=i
    elif len(dic)==4:
        li4 = []
        for i in dic.values():
            li4.append(i)
        ans = li4[0]*li4[1]*li4[2]+li4[0]*li4[1]*li4[3]+li4[0]*li4[2]*li4[3]+li4[1]*li4[2]*li4[3]
    else:
        li4 = []
        for i in dic.values():
            li5.append(i)
        ans =li5[0]*li5[1]*li5[2]+li5[0]*li5[1]*li5[3]+li5[0]*li5[1]*li5[4]+li5[0]*li5[2]*li5[3]+li5[0]*li5[2]*li5[4]+li5[0]*li5[3]*li5[4]+li5[1]*li5[2]*li5[3]+li5[1]*li5[2]*li5[4]+li5[1]*li5[3]*li5[4]+li5[2]*li5[3]*li5[4]
print(ans)
Problem p03486 (python)

Fixed submission:
s = input()
t = input()

ss = ''.join(sorted(s))
tt = ''.join(sorted(t , reverse = True))

if ss < tt:
    print('Yes')
else:
    print('No')

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

print('Yes' if ''.join(sorted(s)) < ''.join(sorted(t,reverse=True) else 'No')
Problem p03609 (python)

Fixed submission:
x,t = map(int, input().split())
print(max(0, x-t))

Buggy submission (verdict: Runtime Error):
x,t = map(int, input().split())
print(max(0. x-t)
Problem p03625 (python)

Fixed submission:
from collections import Counter
n=int(input())
a=[int(i) for i in input().split()]
dic =Counter(a)

li=[]

for i,j in dic.items():
    if j>=2:
        li.append(i)
    if j>=4:
        li.append(i)
li.sort()


if len(li)>=2:
    print(li[-1]*li[-2])
else:
    print(0)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n=int(input())
a=[int(i) for i in input().split()]
dic =Counter(a)

li=[]
li2=[]
for i,j in dic.items():
    if j>=2:
        li.append(i)
    if j>=4:
        li2.append(i)
li.sort()
li2.sort()

if len(li)==1 and len(li2)==1:
    print(li2[0]**2)
else:
    print(li[-1]*max(li[-2],li2[-1]) if len(li)>=2 else 0)
Problem p03633 (python)

Fixed submission:
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
check=t[0]
if n==1:
    print(check)
else:
    for i in range(n-1):
        f1=fractions.gcd(check,t[i+1])
        f2=check*t[i+1]//f1
        check=f2
    print(f2)

Buggy submission (verdict: Runtime Error):
n=int(input())
t=[int(input()) for i in range(n)]

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a
	
check=gcd(t[0],t[1])
ans=t[0]*t[1]//check
for i in range(2,n):
	check=gcd(ans,t[i])
	ans=ans*t[i]//check
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
check=t[0]
for i in range(n-1):
    f1=fractions.gcd(t[i],t[i+1])
    f2=check*t[i+1]//f1
    check=f2
print(f2)

Buggy submission (verdict: Runtime Error):
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
check=t[0]
for i in range(n-1):
    f1=fractions.gcd(t[i],t[i+1])
    f2=t[i]*t[i+1]//f1
    check=f2
print(f2)

Buggy submission (verdict: Runtime Error):
import fractions
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
for i in range(n-1):
    f1=fractions.gcd(t[i],t[i+1])
    f2=t[i]*t[i+1]//f1
print(f2)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
t=[int(input()) for i in range(n)]
t.sort()
for i in range(n-1):
    f1=math.gcd(t[i],t[i+1])
    f2=t[i]*t[i+1]//f1
print(f2)
Problem p03637 (python)

Fixed submission:
n=int(input())
a=[int(i) for i in input().split()] 

check4=0
check2=0
for i in a:
    if i%4==0:
        check4+=1
        continue
    if i%2==0:
        check2+=1
if n==check2:
    ans='Yes'
elif check2<=1:
    if n//2<=check4:
        ans='Yes'
    else:
        ans='No'
else:
    n=n-check2
    if -(-n//2)<=check4:
        ans='Yes'
    else:
        ans='No'
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(i) for i in input().split()]

check=0
check2=0
for i in a:
    if i%4==0:
        check+=1
    elif i%2==0:
        check2+=1
n=n-check2+1
    
else:
    print('Yes' if n//2<=check else 'No')
Problem p03645 (python)

Fixed submission:
n,m=map(int,input().split())
ab=[[int(i) for i in input().split()] for j in range(m)]

li=[[] for i in range(n+1)]

for a,b in ab:
    li[a].append(b)

li2=[]
for i in li[1]:
    li2.append(i)

ans=False
for i in li2:
    if n in li[i]:
        ans=True
print('POSSIBLE' if ans else 'IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ab=[[int(i) for i in input().split()] for j in range(m)]

li=[[] for i in range(m+1)]

for a,b in ab:
    li[a].append(b)

li2=[]
for i in li[1]:
    li2.append(i)

ans=False
for i in li2:
    if n in li[i]:
        ans=True
print('POSSIBLE' if ans else 'IMPOSSIBLE')
Problem p03657 (python)

Fixed submission:
a,b = map(int,input().split())
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
    print('Possible')
else:
    print('Impossible')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a % 3 == 0 or b % 3 == 0 or (a+b) % e == 0:
    print('Possible')
else:
    print('Impossible')
Problem p03681 (python)

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

if abs(n-m)>=2:
    ans=0
else:
    nn=math.factorial(n)
    mm=math.factorial(m)
    ans = nn*mm
print(0 if ans==0 else ans%(10**9+7) if nn !=mm else (ans*2)%(10**9+7))

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

if abs(n-m)>=2:
    ans=0
else:
    nn=math.factorial(n)
    mm=math.factorial(m)
    ans = nn*mm
print(ans%(10**9+7) if nn !=mm else (ans*2)%(10**9+7))

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

if abs(n-m)>=2:
    ans=0
else:
    check=1
    check2=1
    while n >=1:
        check *= n
        n-=1
    while m>=1:
        check2 *=m
        m-=1
    ans=check*check2
print(ans if check !=check2 else ans*2)
Problem p03693 (python)

Fixed submission:
r, g, b = map(int , input().split())
rgb = r*100 + g*10 + b
if rgb % 4 == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
r, g, b = map(int , input(),split())
rgb = r*100 + g*10 + b
if rgb % 4 == 0:
    print('YES')
else:
    print('NO')
Problem p03711 (python)

Fixed submission:
S = 'ACABABAABABA'
x,y = map(int, input().split())
print('Yes' if S[x-1]==S[y-1] else 'No')

Buggy submission (verdict: Runtime Error):
x,y=map(int, input().split())
a = {1,3,5,7,8,10,12}
b = {4,6,9,11}
print('Yes' if x,y<=a or x,y<=b else 'No')

Buggy submission (verdict: Runtime Error):
S = 'ACABABAABABA'
x,y = map(int, input().split())
print('Yes' if S[x]==S[y] else 'No')
Problem p03721 (python)

Fixed submission:
n,k=map(int,input().split())
ab=[[int(i) for i in input().split()]for j in range(n)]
dic={}
for a,b in ab:
    if a in dic:
        dic[a]+=b
    else:
        dic[a]=b
dic=sorted(dic.items() , key=lambda x:x[0])
check=0
for i,j in dic:
    check+=j
    if check>=k:
        print(i)
        break

Buggy submission (verdict: Runtime Error):

n,k=map(int,input().split())
ab=[[int(i) for i in input().split()]for j in range(n)]
dic={}
for a,b in ab:
    if a in dic:
        dic[a]+=j
    else:
        dic[a]=j
dic=sorted(dic.items() , key=lambda x:x[0])
check=0
for i,j in dic:
    check+=j
    if check>=k
    print(i)
    break
Problem p03773 (python)

Fixed submission:
a,b = map(int, input().split())
print((a+b)%24)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input())
print((a+b)%24)
Problem p03910 (python)

Fixed submission:
n=int(input())


if n==1:
    print(1)
    exit()
    
if n==2:
    print(2)
    exit()
    
for i in range(n):
    if i+i**2>=2*n:
        check=i

        break

total=(1+check)*check//2
out=total-n

for i in range(1,check+1):
    if i!=out:
        print(i)

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

for i in range(n):
    if i+i**2>=2*n:
        check=i
        break

total=(1+check)*check//2
out=total-n

for i in range(1,check+1):
    if i!=out:
        print(i)
Problem p03957 (python)

Fixed submission:
s=input()

ans='No'
temp=''
for i in range(len(s)):
    if s[i]=='C':
        temp=s[i:]
        break
for i in temp:
    if i=='F':
        ans='Yes'
        break
        
print(ans)

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

ans='No'
for i in range(len(s)):
    if s[i]=='C':
        temp=s[i:]
        break
for i in temp:
    if i=='F':
        ans='Yes'
        break
        
print(ans)
Problem p03958 (python)

Fixed submission:
k,t=map(int,input().split())
a=[int(i) for i in input().split()]

a=sorted(a,reverse=True)

if len(a)==1:
	ans=a[0]-1

else:
	while True:
		if a[1]==0:
			ans=max(a[0]-1,0)
			break
		a[0]-=1
		a[1]-=1
		a=sorted(a,reverse=True)
print(ans)

Buggy submission (verdict: Runtime Error):
k,t=map(int,input().split())
a=[int(i) for i in input().split()]

a=sorted(a,reverse=True)

while True:
	if a[1]==0:
		ans=max(a[0]-1,0)
		break
	a[0]-=1
	a[1]-=1
	a=sorted(a,reverse=True)
print(ans)
Problem p04034 (python)

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

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	if x in se:
		se.add(y)
		if li[x]==0:
			se.remove(x)
print(len(se))

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

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	print(li)
	if x in se:
		se.add(y)
	if li[x]==0:
		se.remove(x)
print(len(se))

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

li=[1]*(n+1)

se=set()
se.add(1)
for  i in range(m):
	x,y=map(int,input().split())
	li[x]-=1
	li[y]+=1
	print(li)
	if x in se:
		se.add(y)
	if li[x]==0:
		se.remove(x)
print(len(se))
Problem p02687 (python)

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

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    x = int(input())
    for i in range(-1000, 1000):
        for j in range(-1000, 1000):
            if x == i**5 - j**5:
                print(i, j)
                break
        else:
            continue
        break

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    X = int(input())
    i = 0
    while True:
        a = (X + i**5)**(1/5)
        if isinstance(a, float):
            if a.is_integer():
                print(str(int(a))+' '+str(i))
                break

        a = (X - i**5)**(1/5)
        if isinstance(a, float):
            if a.is_integer():
                print(str(int(a))+' '+str(-i))
                break
        i += 1

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
a = int(input())
if a == 'ABC':
    print('ARC')
else:
    print('ABC')