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

Fixed submission:
N, M = (int(i) for i in input().split())
DP = [False]*N
for i in range(M):
  a, b = (int(k) for k in input().split())
  for j in (a, b):
    DP[j-1] = not DP[j-1]
for i in range(N):
  if DP[i]:
    print('NO')
    break
else:
  print('YES')

Buggy submission (verdict: Runtime Error):
N, M = (int(i) for i in input().split())
DP = [False]*N
for i in range(M):
  a, b = (int(k) for k in input().split())
  for j in (a, b):
    DP[j-1] = not DP[j-1]
for i in range(N):
  if DP[i]:
    print(NO)
    break
else:
  print(YES)

Buggy submission (verdict: Runtime Error):
N, M = (int(i) for i in input().split())
DP = [False]*N
for i in range(M):
  a, b = (int(i) for i in input().split())
  for j in (a, b):
    DP[j-1] = not DP[j-1]
for i in range(N):
  if DP[i]:
    print(NO)
    break
else:
  print(YES)

Buggy submission (verdict: Runtime Error):
N, M = (int(i) for i in input().split())
DP[N] = [False]*N
for i in range(M):
  a, b = (int(i) for i in input().split())
  for j in (a, b):
    DP[j-1] = not DP[j-1]
for i in range(N):
  if DP[i]:
    print(NO)
    break
else:
  print(YES)

Buggy submission (verdict: Runtime Error):
N, M = (int(i) for i in input().split())
DP[N] = [False]*N
for i in range(M):
  a, b = (int(i) for i in input().split())
  for i in (a, b):
    DP[i-1] = not DP[i-1]
for i in range(N):
  if DP[i]:
    print(NO)
    break
else:
  print(YES)

Buggy submission (verdict: Runtime Error):
N, M = (int(i) for i in input().split())
DP[N] = [False]*N
for i in range(M):
  a, b = (int(i) for i in input().split())
  for i in (a, b):
    DP[i] = not DP[i]
for i in range(N):
  if DP[i]:
    print(NO)
    break
else:
  print(YES)
Problem p03806 (python)

Fixed submission:
N, Ma, Mb= (int(i) for i in input().split())
L = []
for i in range(N):
    a, b, c = (int(i) for i in input().split())
    L.append((a, b, c))

dp= [[[float("inf")] * (10 * N + 11) for a in range(10 * N + 11) ] for i in range(N + 1)]
dp[0][0][0] = 0

for i in range(N):
    a, b, c = L[i]
    for ca in range(10 * N + 1):
        for cb in range(10 * N + 1):
            dp[i+1][ca][cb] = min(dp[i+1][ca][cb], dp[i][ca][cb])
            dp[i+1][ca + a][cb + b] = min(dp[i+1][ca + a][cb + b], dp[i][ca][cb] + c)

reslis = []
ra, rb = (Ma, Mb)
while ra <= 10 * N and rb <= 10 * N:
    reslis.append(dp[N][ra][rb])
    ra += Ma
    rb += Mb

reslis.sort()
res = reslis[0]
if res == float("inf"):
    print(-1)
else:
    print(res)

Buggy submission (verdict: Runtime Error):
N, Ma, Mb= (int(i) for i in input().split())
L = []
for i in range(N):
    a, b, c = (int(i) for i in input().split())
    L.append((a-1, b-1, c))

dp= [[[float("inf")] * (10 * N + 11) for a in range(10 * N + 11) ] for i in range(N + 1)]
dp[0][0][0] = 0

for i in range(N + 1):
    a, b, c = L[i]
    for ca in range(10 * N + 1):
        for cb in range(10 * N + 1):
            dp[i+1][ca][cb] = min(dp[i+1][ca][cb], dp[i][ca][cb])
            dp[i+1][ca + a][cb + b] = min(dp[i+1][ca + a][cb + b], dp[i][ca][cb] + c)

reslis = []
ra, rb = (Ma, Mb)
while ra <= 10 * N and rb <= 10 * N:
    reslis.append(dp[N][ra][rb])
    ra += Ma
    rb += Mb

reslis.sort()
res = reslis[0]
if res == float("inf"):
    print(-1)
else:
    print(res)

Buggy submission (verdict: Runtime Error):
N, Ma, Mb= (int(i) for i in input().split())
L = []
for i in range(N):
    a, b, c = (int(i) for i in input().split())
    L.append((a-1, b-1, c))

dp= [[[float("inf") for b in range(10 * N + 1)] for a in range(10 * N + 1) ] for i in range(N + 1)]
dp[0][0][0] = 0

for i in range(N):
    a, b, c = L[i]
    for ca in range(10 * N + 1):
        for cb in range(10 * N + 1):
            dp[i+1][ca][cb] = min(dp[i+1][ca][cb], dp[i][ca][cb])
            dp[i+1][ca + a][cb + b] = min(dp[i+1][ca + a][cb + b], dp[i][ca][cb] + c)

reslis = []
ra, rb = (Ma, Mb)
while ra <= 10 * N and rb <= 10 * N:
    reslis.append(dp[N][ra][rb])
    ra += Ma
    rb += Mb

reslis.sort()
res = reslis[0]
if res == float("inf"):
    print(-1)
else:
    print(res)
Problem p03769 (python)

Fixed submission:
from collections import deque

N = int( input() ) + 1 # empty counts

hi = 0
while 1 << hi + 2 <= N:
  hi += 1

ans_A = deque()
ans_B = deque()
ptr = 1
for i in range( hi, -1, -1 ):
  ans_A.append( ptr )
  ans_B.append( ptr )
  ptr += 1
  if N >> i & 1:
    ans_A.append( ptr )
    ans_B.appendleft( ptr )
    ptr += 1

print( len( ans_A ) * 2 )
for i in range( len( ans_A ) ):
  print( ans_A[ i ], end = ' ' )
for i in range( len( ans_B ) ):
  print( ans_B[ i ], end = ' \n'[ i + 1 == len( ans_B ) ] )

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

N = int( input() ) + 1 # empty counts

hi = 0
while 1 << hi + 1 <= N:
  hi += 1
hi -= 1

ans_A = deque()
ans_B = deque()
ptr = 1
for i in range( hi, -1, -1 ):
  ans_A.append( ptr )
  ans_B.append( ptr )
  ptr += 1
  if N >> i & 1:
    ans_A.append( ptr )
    ans_B.appendleft( ptr )
    ptr += 1

print( len( ans_A ) * 2 )
print( * ( ans_A + ans_B ) )

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

N = int( input() )

hi = 0
while 1 << hi + 1 <= N:
  hi += 1

ans_A = deque()
ans_B = deque()
ptr = 1
for i in range( hi, -1, -1 ):
  ans_A.append( ptr )
  ans_B.append( ptr )
  ptr += 1
  if N >> i & 1:
    ans_A.append( ptr )
    ans_B.appendleft( ptr )
    ptr += 1

print( len( ans_A ) * 2 )
print( * ( ans_A + ans_B ) )
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
c = n%(a+b)
d = n//(a+b)
print(a*d+min(a,c))

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
c == n%(a+b)
if c >a:
  print(a*(n//(a+b))+a)
elif c <=a
  print(a*(n//(a+b))+c)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
c == n%(a+b)
if c >a:
  print((n-c)*a/(a+b)+a)
else:
  print((n-c)*a/(a+b)+c)
Problem p02773 (python)

Fixed submission:
import collections
N=int(input())
s=[str(input()) for i in range(N)]
c=collections.Counter(s)
maximum =max(c.values()) 
max_c_list = sorted(key for key,value in c.items() if value == maximum)
for s in max_c_list:
  print(s)

Buggy submission (verdict: Runtime Error):
import collections
N=int(input())
s=[str(input()) for i in range(N)]
c=collections.Counter(s)
maximum =max(c.values()) 
max_c_list = soreted(key for key,value in c.items() if value == maximum)
for s in max_c_list:
  print(s)
Problem p02777 (python)

Fixed submission:
s,t = map(str,input().split())
a,b = map(int,input().split())
u = str(input())
if s == u:
  print(a-1,b)
else:
  print(a,b-1)

Buggy submission (verdict: Runtime Error):
s,t = map(str,input().split())
a,b = map(int,input().split())
u = int(input())
if s == u:
  print(a-1,b)
else:
  print(a,b-1)
Problem p02790 (python)

Fixed submission:
a,b=input().split()
c = str(a)*int(b)
d = str(b)*int(a)
if a<b:
  print(c)
else:
  print(d)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
c = str(a)**b
d = str(b)**a
if a<b:
  print(c)
else:
  print(d)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
c = a**b
d = b**a
if a<b:
  print(c)
else:
  print(d)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c = ("a")**b
d = ("b")**a
if a<b:
  print(c)
else:
  print(d)
Problem p02819 (python)

Fixed submission:
x = int(input())
 
while True:
  flag =0
  for i in range(2,x//2):
    if x%i==0:
      flag =1
      break
  if flag ==0:
    print(x)
    exit()
  x = x+1

Buggy submission (verdict: Runtime Error):
x = int(input())
 
while True:
  flag ==0
  for i in range(2,x//2):
    if x%i==0:
      flag ==1
      break
  if flag ==1:
    print(x)
    exit()
  else:
    x = x+1

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

flag ==0
while True:
  for i in range(2,x//2):
    if x%i==0:
      flag ==1
  if flag ==1:
    print(x)
    exit()
  else:
    x = x+1

Buggy submission (verdict: Runtime Error):
x = int(input())
y = int(x**0.5)

while True:
  x % y != 0:
    y -=1
    if y !=1:
      x +=1
      continue
    elif y ==1:
      break
print(x)
Problem p02829 (python)

Fixed submission:
X = {1,2,3}
a = {int(input())}
b = {int(input())}
print(list(X-a-b)[0])

Buggy submission (verdict: Runtime Error):
X = {1,2,3}
a = int(input())
b = int(input())
print(list(X-set(a)-set(b))[0])

Buggy submission (verdict: Runtime Error):
a = [1,2,3]- int(input())
print(list(a-int(input()))[0])

Buggy submission (verdict: Runtime Error):
a = {1,2,3}- int(input())
print(int(a-int(input())))

Buggy submission (verdict: Runtime Error):
a = {1,2,3}- int(input())
print(a-int(input()))

Buggy submission (verdict: Runtime Error):
a = {(1,2,3)}- int(input())
print(a-int(input()))
Problem p02847 (python)

Fixed submission:
n = str(input())
dic = {"SUN":7,
       "MON":6,
       "TUE":5,
       "WED":4,
       "THU":3,
       "FRI":2,
       "SAT":1}
print(dic[str(n)])

Buggy submission (verdict: Runtime Error):
n = str(input())
dic = {SUN:7,
       MON:6,
       TUE:5,
       WED:4,
       THU:3,
       FRI:2,
       SAT:1}
print(dic(n))
Problem p02860 (python)

Fixed submission:
n = int(input())
a = input()
if a[:n//2]==a[n//2:]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input()
if a[:n/2+1]==a[n/2+1:]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input()
if str(a[:n/2+1])==str(a[n/2+1:]):
  print("Yes")
else:
  print("No")
Problem p02881 (python)

Fixed submission:
n = int(input())
 
b = 10**12
a = int((n**0.5)//1)
for i in range(1,a+1):
  if n%i==0:
    b = min(b,int(i+(n//i)-2))
print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = 10**12
a = int((n**0.5)//1)
for i in a:
  if n%i==0:
    m=min(m,i+(n/i)-2)
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = 10**12
a = (n**0.5)//1
for i in a:
  if n%i==0:
    m=min(m,i+(n/i)-2)
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = 10**12
for i in int(n**0.5//1):
  if n%i==0:
    m=min(m,i+(n/i)-2)
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = 10**12
for i in n:
  for j in n:
    if i*j==n:
      m=min(m,i+j-2)
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = 10**12
for i in n:
  for j in n:
    if i*j=n:
      m=min(m,i+j-2)
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = 10**12
for i in n:
  for j in n:
    if i*j==n:
      m=min(m,(i+j-2))
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = []
for i in n:
  for j in n:
    if i*j==n:
      m.append(i+j-2)
print(min(m))
Problem p02935 (python)

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

Buggy submission (verdict: Runtime Error):
x = int(input())
a = [list(map(int,input().split()))]
b = sorted(a)
y = 0
for i in range(x):
  y += b[i-0]*(2**i)
print(y//(2**(x+1)))

Buggy submission (verdict: Runtime Error):
x = int(input())
a = [list(map(int,input().split()))]
b = sorted(a)
y = 0
for i in range(x):
  y += b[i-0]*2**i
print(y/(2**(x+1)))
Problem p02970 (python)

Fixed submission:
import math
n,d = map(int,input().split())
print(math.ceil(n/(2*d+1)))

Buggy submission (verdict: Runtime Error):
n,d = map(int,input().split())
p = n/(2d+1)
if p % 1 ==0:
  print(p)
else:
  print((p//1)+1)

Buggy submission (verdict: Runtime Error):
import math
n,d = map(int,input().split())
print(math.ceil(n/(2d+1)))
Problem p03012 (python)

Fixed submission:
n = int(input())
mlist = list(map(int,input().split()))
nlist =[]
for i in range(n):
  nlist.append(abs(sum(mlist[:i])-sum(mlist[i:])))
print(min(nlist))

Buggy submission (verdict: Runtime Error):
n = int(input())
mlist = list(map(int,input().split()))
nlist =[]
for i in range(n):
  nlist.append(abs(mlist[:i]-mlist[i:]))
print(min(nlist))
Problem p03073 (python)

Fixed submission:
n = input()
s = n[::2].count("0")+n[1::2].count("1")
print(min(s,len(n)-s))

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

counta = 0
countb = 0
if N%2==0:
  for i in range(0,len(n)-2,2):
    if n[i]=="0":
      counta+=1
    elif n[i]=="1":
      countb+=1
  for i in range(1,len(n)-1,2):
    if n[i]=="1":
      counta+=1
    elif n[i]=="0":
      countb+=1
  print(min(counta,countb))

counta = 0
countb = 0
if N%2==1:
  for i in range(0,len(n)-1,2):
    if n[i]=="0":
      counta+=1
    elif n[i]=="1":
      countb+=1
  for i in range(1,len(n)-2,2):
    if n[i]=="1":
      counta+=1
    elif n[i]=="0":
      countb+=1
  print(min(counta,countb))
Problem p03077 (python)

Fixed submission:
n = int(input())
x = [int(input()) for i in range(5)]
d = n // min(x)
if n%min(x)==0:
  print(d+4)
else:
  print(d+5)

Buggy submission (verdict: Runtime Error):
n = int(input().split())
x = [int(input()) for i in range(5)]
d = n // min(x)
print(d+5)

Buggy submission (verdict: Runtime Error):
n = int(input().split())
x = [int(intpu()) for i in range(5)]
d = n // min(x)
print(d+5)
Problem p03127 (python)

Fixed submission:
from functools import reduce
from math import gcd
n = int(input())
xlist = list(map(int,input().split()))
print(reduce(gcd, xlist))

Buggy submission (verdict: Runtime Error):
n = int(input())
xlist = list(map(int,input().split()))
a = xlist[0]
for i in range(1,n):
  a = fractions.gcd(a,xlist[i])
print(a)
Problem p03207 (python)

Fixed submission:
n=int(input())
k = [int(input()) for i in range(n)]
print(sum(k)-max(k)//2)

Buggy submission (verdict: Runtime Error):
n=int(input())
k = [int(input()) for i in range(n)]
print(int((sum(k)-max(k)//2))
Problem p03221 (python)

Fixed submission:
import collections
import bisect
n,m=map(int,input().split())
p=[[int(j) for j in input().split()] for i in range(m)]
a=collections.defaultdict(list)
for x,y in sorted(p):
    a[x]+=[y]
for x,y in p:
    z=bisect.bisect(a[x],y)
    print("%06d%06d"%(x,z))

Buggy submission (verdict: Runtime Error):
import collections
import bisect
n,m=map(int,input().split())
p = [map(int,input().splilt()) for i in range(m)]
a=collections.defaultdict(list)
for x,y in sorted(p):
    a[x]+=[y]
for x,y in p:
    z=bisect.bisect(a[x],y)
    print("%06d%06d"%(x,z))

Buggy submission (verdict: Runtime Error):
import collections
import bisect
n,m=map(int,input().split())
p = [list(map(int,input().splilt())) for i in range(m)]
a=collections.defaultdict(list)
for x,y in sorted(p):
    a[x]+=[y]
for x,y in p:
    z=bisect.bisect(a[x],y)
    print("%06d%06d"%(x,z))

Buggy submission (verdict: Runtime Error):
import collections
import bisect
n,m = map(int,input().split())
p = [list(map(int,input().splilt())) for i in range(m)]
a = collections.defaultdict(list)
for x,y in sorted(p):
  a[x]+=[y]
for x,y in p:
  z = bisect.bisect(a[x],y)
  print("%06d%06d"%(x,z))

Buggy submission (verdict: Runtime Error):
import collections
import bisect
n,m = map(int,input().split())
p = [list(map(int,input().splilt())) for i in range(m)]
a = collections.deefaultdict(list)
for x,y in sorted(p):
  a[x]+=[y]
for x,y in p:
  z = bisect.bisect(a[x],y)
  print("%06d%06d"%(x,z))
Problem p03242 (python)

Fixed submission:
n = input()
n = n.replace("9","4").replace("1","9").replace("4","1")
print(n)

Buggy submission (verdict: Runtime Error):
n=int(input())
print(100*(10-n[0])+10*(10-n[1])+10-n[2])

Buggy submission (verdict: Runtime Error):
n=input()
print(100*(10-n[0])+10*(10-n[1])+10-n[2])
Problem p03252 (python)

Fixed submission:
import collections
a = list(input())
b = list(input())
A = collections.Counter(a)
B = collections.Counter(b)
Alist = list(A.values())
Blist = list(B.values())
Asort = sorted(Alist)
Bsort = sorted(Blist)
if Asort == Bsort:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import collections
a = list(input())
b = list(input())
A = collections.Counter(a)
B = collections.Counter(b)
Asort = sorted(A.values())
Bsort = sorted(B.values())
if list(Asort.values()) == list(Bsort.values()):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import collections
a = list(str(input()))
b = list(str(input()))
A = collections.Counter(a)
B = collections.Counter(b)
Asort = sorted(A.values())
Bsort = sorted(B.values())
if list(Asort.values()) == list(Bsort.values()):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import collections
a = list(str(input()))
b = list(str(input()))
A = collections.Counter(a)
B = collections.Counter(b)
Asort = sorted(A.values())
Bsort = sorted(B.values())
if Asort.values() == Bsort.values():
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import collections
a = list(input())
b = list(input())
A = collections.Counter(a)
B = collections.Counter(b)
Asort = sorted(A.values())
Bsort = sorted(B.values())
if Asort.values() == Bsort.values():
  print("Yes")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
import collections
a = list(map(str,input().split()))
b = list(map(str,input().split()))
A = collections.Counter(a)
B = collections.Counter(b)
Asort = sorted(A.values())
Bsort = sorted(B.values())
if Asort.values() == Bsort.values():
  print("Yes")
else:
  print("NO")
Problem p03286 (python)

Fixed submission:
N = int(input())
a = ""
if N ==0:
  a =0
while N !=0:
  if N%2 != 0:
    a = "1" + a
  else:
    a = "0" + a
  N = - (N//2)
print(a)

Buggy submission (verdict: Runtime Error):
N = input()
a = ""
if N ==0:
  a =0
while N !=0:
  if N%2 != 0:
    a = "1" + a
  else:
    a = "0" + a
  N = - (N//2)
print(a)