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

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

from fractions import gcd

highest_concentration=-1

for a in range(F//(100*A) +1):
  for b in range((F-100*A*a)//(100*B) +1):
    water = 100*A*a + 100*B*b
    if not water:
      continue
      
    max_sugar = min(E*(A*a+B*b), F-water)
    
    for c in range(min(D,(max_sugar//C)+1)):
      d = (max_sugar -c*C)//D
      sugar = c*C + d*D
      if sugar/(water+sugar) > highest_concentration:
        highest_concentration = sugar/(water+sugar)
        #print(a,b,c,d, 100*a*A+100*b*B, sugar)
        #print(water,water+sugar, sugar)
        answer = (water+sugar, sugar)
        
print(*answer)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F=list(map(int, input().split()))

from fractions import gcd

highest_concentration=0

for a in range(F//(100*A) +1):
  for b in range((F-100*A*a)//(100*B) +1):
    water = 100*A*a + 100*B*b
    if not water:
      continue
    max_sugar = min(E*(A*a+B*b), F-water)
    
    lcm = C*D//gcd(C,D)
    
    #(max_sugar//lcm)*lcm
    for c in range((max_sugar%lcm)//C + 1):
      d = (max_sugar%lcm -c*C)//D
      
      sugar = (max_sugar//lcm)*lcm + c*C + d*D
      if sugar/(water+sugar) > highest_concentration:
        highest_concentration = sugar/(water+sugar)
        #print(a,b,c,d, 100*a*A+100*b*B, sugar)
        #print(water,water+sugar, sugar)
        answer = (water+sugar, sugar)
        
print(*answer)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F=list(map(int, input().split()))

from fractions import gcd

highest_concentration=0

for a in range(F//(100*A) +1):
  for b in range((F-100*A*a)//(100*B) +1):
    water = 100*A*a + 100*B*b
    if not water:
      continue
    max_sugar = min(E*(A*a+B*b), F-water)
    
    lcm = C*D//gcd(C,D)
    
    #(max_sugar//lcm)*lcm
    for c in range((max_sugar%lcm)//C + 1):
      d = (max_sugar%lcm -c*C)//D
      
      sugar = (max_sugar//lcm)*lcm + c*C + d*D
      if sugar/(water+sugar) > highest_concentration:
        highest_concentration = sugar/(water+sugar)
        #print(a,b,c,d, 100*a*A+100*b*B, sugar)
        #print(water,water+sugar, sugar)
        answer = (water+sugar, sugar)
print(*answer)A,B,C,D,E,F=list(map(int, input().split()))

from fractions import gcd

highest_concentration=0

for a in range(F//(100*A) +1):
  for b in range((F-100*A*a)//(100*B) +1):
    water = 100*A*a + 100*B*b
    if not water:
      continue
    max_sugar = min(E*(A*a+B*b), F-water)
    
    lcm = C*D//gcd(C,D)
    
    #(max_sugar//lcm)*lcm
    for c in range((max_sugar%lcm)//C + 1):
      d = (max_sugar%lcm -c*C)//D
      
      sugar = (max_sugar//lcm)*lcm + c*C + d*D
      if sugar/(water+sugar) > highest_concentration:
        highest_concentration = sugar/(water+sugar)
        #print(a,b,c,d, 100*a*A+100*b*B, sugar)
        #print(water,water+sugar, sugar)
        answer = (water+sugar, sugar)
print(*answer)
Problem p03625 (python)

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

temp_set=set()

l = []

for a in A:
  if a in temp_set:
    l.append(a)
    temp_set.remove(a)
  else:
    temp_set.add(a)
    
l.sort()
if len(l)>=2:
  print(l[-2]*l[-1])
else:
  print(0)

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

temp_set=set()

l = []

for a in A:
  if a in temp_set:
    l.append(a)
    temp_set.remove(a)
  else:
    temp_set.add(a)
    
l.sort()
print(l[-2]*l[-1])
Problem p03633 (python)

Fixed submission:
N=int(input())
T = [int(input()) for _ in range(N)]

from functools import reduce
from fractions import gcd

def lcm(a,b):
  return a*b //gcd(a,b)

print(reduce(lcm, T))

Buggy submission (verdict: Runtime Error):
N=int(input())
T = [int(input()) for _ in range(N)]

from functools import reduce
from fraction import gcd

def lcm(a,b):
  return a*b //gcd(a,b)

print(reduce(lcm, T))
Problem p03699 (python)

Fixed submission:
N=int(input())
S=[int(input()) for _ in range(N)]

if sum(S)%10:
  print(sum(S))
  exit()

else:
  S.sort()
  for s in S:
    if s%10:
      print(sum(S) - s)
      exit()
  else:
    print(0)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=[int(input()) for _ in range(N)]

if sum(S)%10:
  print(sum(s))
  exit()

min_s1=101

for s in S:
  if s%10:
    min_s1 = min(s, min_s1)

print(sum(S) - min_s1)
Problem p03807 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
odd = [a for a in A if a%2]

if len(odd)%2:
  print('NO')
else:
  print('YES')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
odd = [a for a in A if a%2]

if odd%2:
  print('NO')
else:
  print('YES')
Problem p03846 (python)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
mod=int(1e9+7)

memo={i:0 for i in range(n)}
for a in A:
  memo[a]=memo.get(a,0)+1

answer=1
if n%2:
  if memo[0]!=1:
    print(0)
    exit()
  for i in range(1, (n+1)//2):
    if memo[2*i]!=2:
      print(0)
      exit()
    else:
      answer = 2*answer %mod
elif not n%2:
  for i in range(n//2):
    if memo[2*i+1]!=2:
      print(0)
      exit()
    else:
      answer = 2*answer %mod
      
print(answer)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
mod=int(1e9+7)

memo={}
for a in A:
  memo[a]=memo.get(a,0)+1

answer=1
if n%2:
  if memo[0]!=1:
    print(0)
    exit()
  for i in range(1, (n+1)//2):
    if memo[2*i]!=2:
      print(0)
      exit()
    else:
      answer = 2*answer %mod
elif not n%2:
  for i in range(n//2):
    if memo[2*i+1]!=2:
      print(0)
      exit()
    else:
      answer = 2*answer %mod
      
print(answer)

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

if N%2:
  A = A+ [0]

Adict={}
for a in A:
  Adict[a] = Adict.get(a, 0) +1
  
#print(Adict)

# 0,0,2,2,4,4  5   (i//2)*2 + 1- N%2 0,2,4
# 1,1,3,3,5,5  6

#print(range(1-N%2, N, 2))
#print(all([Adict[i]==2 for i in range(1-N%2, N, 2)]))

if all([Adict[i]==2 for i in range(1-N%2, N, 2)]):
  answer = 1
  for _ in range(N//2):
    answer = (answer * 2)%1000000007
  print(answer)
else:
  print(0)

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

if N%2:
  A = A+ [0]
  
print(A)
  
Adict={}
for a in A:
  Adict[a] = Adict.get(a, 0) +1
  
#print(Adict)

# 0,0,2,2,4,4  5   (i//2)*2 + 1- N%2 0,2,4
# 1,1,3,3,5,5  6

#print(range(1-N%2, N, 2))
#print(all([Adict[i]==2 for i in range(1-N%2, N, 2)]))

if all([Adict[i]==2 for i in range(1-N%2, N, 2)]):
  answer = 1
  for _ in range(N//2):
    answer = (answer * 2)%1000000007
  print(answer)
else:
  print(0)

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

if N%2:
  A = A+ [0]
  
Adict={}
for a in A:
  Adict[a] = Adict.get(a, 0) +1

# 0,0,2,2,4,4  5   (i//2)*2 + 1- N%2 0,2,4
# 1,1,3,3,5,5  6

if all([Adict[i]==2 for i in range(1-N%2, N, 2)]):
  print(2**(N//2))
else:
  print(0)
Problem p04000 (python)

Fixed submission:
H, W, N = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(N)]

from itertools import product

S = [set() for _ in range(10)]
# S[i]: set(黒いマスをi個こ含む3*3マスの中心セル)

for a,b in AB:
  for x,y in product([-1,0,1], repeat=2):
    X = a+x-1
    Y = b+y-1
    if X<=0 or H-1<=X or Y<=0 or W-1<=Y:
      continue
    for i in range(10):
      if (X, Y) in S[i]:
        S[i].remove((X, Y))
        S[i+1].add((X, Y))
        break
    else:
      S[1].add((X, Y))

L = [len(s) for s in S[1:]]
print((H-2)*(W-2) - sum(L))

for l in L:
  print(l)

Buggy submission (verdict: Runtime Error):
H, W, N = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(N)]

from itertools import product

S = [set() for _ in range(10)]
# S[i]: set(黒いマスをi個こ含む3*3マスの中心セル)

for a,b in AB:
  for x,y in product([-1,0,1], repeat=2):
    X = a+x-1
    Y = b+y-1
    if X<=0 or H-1<=X or Y<=0 or W-1<=Y:
      continue
    for i in range(10):
      if (X, Y) in S[i]:
        S[i].remove((X, Y))
        S[i+1].add((X, Y))
        N[i] -=1
        N[i+1] +=1
        break
    else:
      S[1].add((X, Y))
      N[1] +=1
      N[0] -=1

L = [len(s) for s in S[1:]]
print((H-2)*(W-2) - sum(L))

for l in L:
  print(l)
Problem p04013 (python)

Fixed submission:
import numpy as np

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

dp = [np.array([[0]*(N*A+1) for _ in range(N+1)])]
#dp[0]: [0, 0]～[N, N*A]

for x in X:
  new_dp = dp[-1].copy()
  new_dp[1:, x:] += dp[-1][0:N, 0:N*A+1-x]
  if x<=N*A:
    new_dp[1, x] += 1
  
  dp.append(new_dp)
#print(dp[-1])
  
print(sum([dp[-1][i, i*A] for i in range(1, N+1)]))

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

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

dp = [np.array([[0]*(N*A+1) for _ in range(N+1)])]
#dp[0]: [0, 0]～[N, N*A]

for x in X:
  new_dp = dp[-1]
  new_dp[1:, x:] += dp[-1][0:N, 0:N*A+1-x]
  new_dp[1, x] += 1
  
  dp.append(new_dp)
#print(dp[-1])
  
print(sum([dp[-1][i, i*A] for i in range(1, N+1)]))

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

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

dp = [np.array([[0]*(N*A+1) for _ in range(N+1)])]
#dp[0]: [0, 0]～[N, N*A]

for x in X:
  new_dp = dp[-1]
  new_dp[1:, x:] += dp[-1][0:N, 0:N*A+1-x]
  new_dp[1, x] += 1
  
  dp.append(new_dp)
print(dp[-1])
  
print(sum([dp[-1][i, i*A] for i in range(1, N+1)]))

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

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

dp = [np.array([[0]*(N*A+1) for _ in range(N+1)])]
#dp[0]: [0, 0]～[N, N*A]

for x in X:
  new_dp = dp[-1]
  new_dp[1:, x:] += dp[-1][0:N, 0:N*A+1-x]
  new_dp[1, x] += 1
  
  dp.append(new_dp)
#print(dp[-1])
  
print(sum([dp[-1][i][i*A] for i in range(1, N+1)]))

Buggy submission (verdict: Runtime Error):
import numpy as np
from scipy.ndimage.interpolation import shift

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

dp = [np.array([[0]*(N*A+1) for _ in range(N+1)])]
#dp[0]: [0][0]～[N][N*A]

for x in X:
  new_dp = dp[-1] + shift(dp[-1], [1, x], cval=0)
  new_dp[1][x] += 1
  
  dp.append(new_dp)
#print(dp[-1])
  
print(sum([dp[-1][i][i*A] for i in range(1, N+1)]))

Buggy submission (verdict: Runtime Error):
import numpy as np
from scipy.ndimage.interpolation import shift

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

dp = [np.array([[0]*(N*A+1) for _ in range(N)])]

for i in range(N):
  new_dp = dp[-1]+ shift(dp[-1], [1, X[i]], cval=0)
  new_dp[0][X[i]]=new_dp[0][X[i]]+1
  
  dp.append(new_dp)
#print(dp[-1])
  
print(sum([dp[-1][i-1][i*A] for i in range(1,N+1)]))
Problem p02608 (python)

Fixed submission:
N = int(input())

N2 = int(N**0.5)

cnt = [0] * (90000)

for x in range(1,N2+1):
  for y in range(1,N2+1):
    for z in range(1,N2+1):
      xyz = x*x + y*y + z*z + x*y + y*z + z*x
      cnt[xyz] += 1
#
for i in range(1,N+1):
  print( cnt[i] )

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

N2 = int(N**0.5)

cnt = [0] * (9000)

for x in range(1,N2+1):
  for y in range(1,N2+1):
    for z in range(1,N2+1):
      xyz = x*x + y*y + z*z + x*y + y*z + z*x
      cnt[xyz] += 1
#
for i in range(1,N+1):
  print( cnt[i] )
Problem p02618 (python)

Fixed submission:
import numpy as np

D = int(input())
c = np.array( list(map(int, input().split())) )
s = [[] for i in range(365)]
for i in range(D):
  s[i] = np.array( list(map(int, input().split())) )
#
last = np.array( [-1]*26 )
av = np.array( [0]*26 )
id = np.identity(4,dtype=int)

v = 0
for d in range(D):
  av = s[d] - sum( c*(d-last) ) + c*(d-last) 
  m = max(av)
  for t in range(26):
    if av[t] == m:
      last[t] = d
      v += av[t]
      print(t+1)
      break
#

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

D = int(input())
c = np.array( list(map(int, input().split())) )
#
s = [[] for i in range(D)]
for i in range(D):
  s[i] = np.array( list(map(int, input().split())) )
#
v = 0
cc =  np.array( [0]*26 )
last = np.array( [-1]*26 )
for d in range(D):
  cc += c
  av = s[d] - sum( cc ) + cc
  av2 = av + cc*(D-d-1) + c*(D-d-1)(D-d)//2
  m = max(av2)
  for t in range(26):
    if av2[t] == m:
      cc[t] = 0
      v += av[t]
      print(t+1)
      break
#
#print( v )
Problem p02642 (python)

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

cnt = [0] * 1000001

for i in A:
  if cnt[i] == 1:
    continue 
  if cnt[i] == 2:
    cnt[i] = 1
    continue
  cnt[i] = 2
  for j in range( (i+i),1000001,i):
    cnt[j] = 1
#
ans = 0
for i in range(1000001):
  if cnt[i] == 2:
    ans += 1
#
print(ans)

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

cnt = [0] * 200001

for i in A:
  if cnt[i] == 1:
    continue 
  if cnt[i] == 2:
    cnt[i] = 1
    continue
  cnt[i] = 2
  for j in range( (i+i),200001,i):
    cnt[j] = 1
#
ans = 0
for i in range(200001):
  if cnt[i] == 2:
    ans += 1
#
print(ans)
Problem p02678 (python)

Fixed submission:
import heapq

N, M  = map(int, input().split())

node = [[] for i in range(N+1)]
for i in range(M):
  a, b = map(int, input().split())
  node[a].append(b)
  node[b].append(a)
#

gw = [0]*(N+1)
gw[1] = 1
ng=1
hq = []
heapq.heapify(hq) 
heapq.heappush(hq,(0,1))
while hq:
  c, n = heapq.heappop(hq)
  for i in node[n]:
    if gw[i] == 0:
      gw[i] = n
      ng += 1
      heapq.heappush(hq,(c+1,i))
#
if ng < N:
  print("No")
else:
  print("Yes")
  for i in range(2,N+1):
    print(gw[i])
#

Buggy submission (verdict: Runtime Error):
6 9
3 4
6 1
2 4
5 3
4 6
1 5
6 2
4 5
5 6
Problem p02683 (python)

Fixed submission:
import numpy as np
import itertools

N, M, X = map(int, input().split())

ca = []
for _ in range(N):
  ca.append( list(map(int, input().split())))
ca = np.array(ca)
#print(ca)
ans = 10000000

b = [0,1]
for p in list(itertools.product(b, repeat=N)): 
  a = np.array(p)
  to = a@ca
  if min(to[1:]) >= X:
    ans = min(ans, to[0])
#
if ans == 10000000:
  print(-1)
else:
  print(ans)
#

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

N, M, X = map(int, input().split())

ca = []
for _ in range(N):
  ca.append( list(map(int, input().split())))
ca.sort(key=lambda x:-x[0])
ca = np.array(ca)
#
ans = 10000000
skill = [0]*(M+1)


def DFS(n,skill):
  global ans
  if skill[0] >= ans:
    return
  if min(skill[1:]) >= X:
    ans = min(ans, skill[0])
    return
  if n >= N:
    return
  DFS(n+1,skill)
  skill = skill + ca[n]
  DFS(n+1,s)
  skill = skill - ca[n]
  return
#

DFS(0,skill)
if ans == 10000000:
  print(-1)
else:
  print(ans)
#
Problem p02690 (python)

Fixed submission:
x=int(input())

for a in range(0,200):
  a5 = a**5
  b5 = a5 - x
  if b5 >= 0:
    b = int( float(b5)**0.2 )
    if b**5 == b5:
      print(a,b)
      break
  else:
    b5 = -b5
    b = int( float(b5)**0.2 )
    if b**5 == b5:
      print(a,-b)
      break
#

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

for b in range(0,200):
  b5 = b**5
  a5 = x + b5
  a = int( float(a5)**0.2 )
  if a**5 == a5:
    print(a,b)
    break
  a5 = x - b5
  a = int( float(a5)**0.2 )
  if a**5 == a5:
    print(a,-b)
    break
#

Buggy submission (verdict: Runtime Error):
x=int(input())
a5=[0]
for i in range(1,200):
  a5.append(i**5)
#
r=0
for i in range(200):
  for j in range(i+1,200):
    if a5[j]-a5[i]>x:
      break
    if a[j]-a5[i]==a:
      print(a[i],a[j])

Buggy submission (verdict: Runtime Error):
x=int(input())
a5=[0]
for i in range(1,200):
  a5.append(i**5)
#
r=0
for i in range(200):
  for j in range(i+1,200):
    if a5[j]-a5[i]>x:
      break
    if a[j]-a5[i]==a:
      print(a[i],a[j])
Problem p02708 (python)

Fixed submission:
N, K = map(int, input().split())
mod = 1000000000+7

z=0

zz = ((N-K+1)+N)*K//2 - (0+(K-1))*K//2 + 1
zz = zz % mod

for x in range(K+1, N+3):
#  print(zz)
  z = (z + zz) % mod
  zz += (N-x+1) - (x-1)
  zz = zz % mod
#
print(z)

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

print(K,N)


mod = 1000000000+7

z=0
for x = range(K, N+2):
  for y = range(0,x):
    z += (N-y) - y + 1
    z %= mod
#
print(z)

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

mod = 1000000000+7

z=0
for x = range(K, N+2):
  for y = range(x):
    z += (N-y) - y + 1
    z %= mod
#
print(z)
Problem p02741 (python)

Fixed submission:
I = input().split()
         
K = int(I[0])
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print( A[K-1] )

Buggy submission (verdict: Runtime Error):
    I = input().split()
     
    K = int(I[0])
    A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    print( A[K-1] )

Buggy submission (verdict: Runtime Error):
I = input().split()

K = int(I[0])
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print( A[K] )
Problem p02741 (python)

Fixed submission:
nums = [0, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[int(input())])

Buggy submission (verdict: Runtime Error):
chars = ['a','b','c','d','e','f','g','h','i','j']
length = int(input())
def cals(words, num, length):
  work = words
  for val in range(0, length):
    temp = work + chars[val]
    if num + 1 == length:
      print(temp)
    else:
      cals(temp, num + 1, length)
      break
cals('',0 , length)

Buggy submission (verdict: Runtime Error):
value = input().split()
rows = int(value[0])
colmuns = int(value[1])
OddColNum = colmuns // 2 
EvenColNum = OddColNum
if (colmuns % 2) != 0:
  OddColNum = OddColNum + 1
if (colmuns == 1):
  OddColNum = 1

OddRowCount = rows // 2
EvenRowCount = rows // 2
if (OddRowCount % 2) != 0 and rows != 1:
  OddRowCount = OddRowCount + 1
if (rows == 1):
  OddRowCount = 1

print(OddColNum)
print(EvenColNum)
print(OddRowCount)
print(EvenRowCount)
counts = OddRowCount * OddColNum + EvenColNum * EvenRowCount
print(counts)
Problem p02747 (python)

Fixed submission:
import re

pattern = '(hi)+'
compiled = re.compile(pattern)
input_value = input()
result = compiled.match(input_value)
if result == None:
  print('No')
elif result.group() == input_value:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import sys

counts = list(map(int,input().split()))
colors = list(map(int,input().split()))
hots = list(map(int,input().split()))
colorsCount = counts[0]
hotsCount = counts[1]
ticketCount = counts[2]

minPrice = sys.maxsize
# first. get disscount consider price
for i in range(ticketCount):
  values = input().split()
  x = int(values[0])
  y = int(values[1])
  dissPrice = int(values[2])
  colorPrice = colors[x-1]
  hotsPrice = hots[y-1]
  validPrice =  colorPrice + hotsPrice - dissPrice
  if minPrice > validPrice:
    minPrice = validPrice

max_color = max(colors)
max_color_idx = colors.index(max_color)
max_hots = max(hots)
max_hots_idx = hots.index(max_hots)
validPrice = max_color + max_hots
if minPrice > validPrice:
  minPrice = validPrice
  
print(str(minPrice))

Buggy submission (verdict: Runtime Error):
import sys

counts = list(map(int,input().split()))
colors = list(map(int,input().split()))
hots = list(map(int,input().split()))
colorsCount = counts[0]
hotsCount = counts[1]
ticketCount = counts[2]

minPrice = sys.maxsize
# first. get disscount consider price
for i in range(ticketCount):
  values = input().split()
  x = int(values[0])
  y = int(values[1])
  dissPrice = int(values[2])
  colorPrice = colors[x-1]
  hotsPrice = hots[y-1]
  validPrice =  colorPrice + hotsPrice - dissPrice
  if minPrice > validPrice:
    minPrice = validPrice

max_color = max(colors)
max_color_idx = colors.index(max_color)
max_hots = max(hots)
max_hots_idx = hots.index(max_hots)
validPrice = max_color + max_hots
if minPrice > validPrice:
  minPrice = validPrice
print(str(minPrice))
Problem p03238 (python)

Fixed submission:
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):
n = int(input())
A = int(input())
B = int(input())

if n == 1:
    print("Hello World")
if n == 2:
    print(A + B)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = int(input())
B = int(input())
if n == 1:
    print("Hello World")
elif n == 2:
    print(A + B)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = int(input())
B = int(input())
if n == 1:
    print("Hello World")
else:
    print(A + B)
Problem p03351 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
if  abs(c-a) <= d:
	print("Yes")
elif abs(a-b) <= d and abs(b-c) <= d:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if  abs(c-a) =< d:
	print("Yes")
elif abs(a-b) =< d and abs(b-c) =< d:
	print("Yes")
else:
	print("No")
Problem p03434 (python)

Fixed submission:
input()
a = list(map(int,input().split()))
a.sort(reverse = True)
print(sum(a[0::2]) - sum(a[1::2]))

Buggy submission (verdict: Runtime Error):
n = input()
for i in n:
    a = list(map(int,input().split()))
a.sort(reverse = True)
print(sum(a[0::2]) - sum(a[1::2]))

Buggy submission (verdict: Runtime Error):
n = input()
for i in n:
    a = list(map(int,input().split()))
a.sort(reverse = True)
Bob = sum(a[1::2])
Alice = sum(a[0::2])
print(Alice - Bob)
Problem p03493 (python)

Fixed submission:
s1 = input()
print(s1.count('1'))

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
A = [int(x) for x in input().split()]
while all(i % 2 == 0 for i in A):
    A = [i/2 for i in A]
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = map(int,input().split())
l = []
l += [s1,s2,s3]
print(l.count(1))
Problem p03501 (python)

Fixed submission:
price =input().split()
if int(price[0]) *  int(price[1]) > int(price[2]) :
	print(int(price[2]))
else :
	print(int(price[0]) * int(price[1]))

Buggy submission (verdict: Runtime Error):
price = int(input()).split()
if  price > B:
  print(B)
else:
  print(N * A)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
if  price > B:
  print(B)
else:
  print(N * A)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
price = N * A
if  price > B:
  print(B)
else:
  print(price)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
price = N * A
if  price > B:
  print(B)
else:
  print(price)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
price =N * A
if  price > B:
  print(B)
else:
  print(price)
Problem p03605 (python)

Fixed submission:
a = input()
if "9" in a:
  print("Yes")
else :
  print("No")

Buggy submission (verdict: Runtime Error):
a = int(input())
if "9" in a:
  print("Yes")
else :
  print("NO")
Problem p03672 (python)

Fixed submission:
s = input()

for l in range(len(s) -1, 1, -1):
    if l % 2 != 0:
        continue
    if s[:l // 2] == s[l // 2:l]:
        print(l)
        break

Buggy submission (verdict: Runtime Error):
S = input()
for i in range(len(S) -1,-1,-1):
  if i % 2 != 0:
    continue
  if s[:i // 2] == s[i // 2:i]:
    print(i)
    break
Problem p03845 (python)

Fixed submission:
n = int(input())
t = list(map(int,input().split()))
sumt = sum(t)
m = int(input())
l = []
for i in range(m):
    p, x = map(int,input().split())
    a = sum(t)+x-t[p-1]
    l.append(a)
for o in l:
    print(o)

Buggy submission (verdict: Runtime Error):
N = int(input())
T = list(map(int,input().split()))
M = int(input())
P,X  = [],[]
for i in range(M):
	p,x = map(int,input().split())
	P.append(p - 1)
	X.append(x)
sumA = sum(T)
for lack in range(M):
	print(T + X[i] + T[P[i]] )
Problem p03852 (python)

Fixed submission:
text = input()
list1 = ['a','e','i','o','u']
if text in list1:
	print("vowel")
else:
	print("consonant")

Buggy submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
for i in range(H):
    C = input()
    print(C)
    print(C)