Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

tmp = list(map(int, input().split()))
n = tmp[0]
m = tmp[1]
a = list(map(int, input().split()))

heapq.heapify(a)

for j in range(m):
  tmp = list(map(int, input().split()))
  b = tmp[0]
  c = tmp[1]

  for k in range(b):
    if a[0] < c:
      heapq.heappop(a)
      heapq.heappush(a, c)
    else:
      break

print(sum(a))  

Fixed submission:
import heapq

tmp = list(map(int, input().split()))
n = tmp[0]
m = tmp[1]
a = list(map(int, input().split()))

heapq.heapify(a)

cb = []
for j in range(m):
  tmp = list(map(int, input().split()))
  cb.append((tmp[1], tmp[0]))
cb.sort(reverse=True)

for j in range(m):
  if cb[j][0] < a[0]:
    break
  for k in range(cb[j][1]):
    if a[0] < cb[j][0]:
      heapq.heappop(a)
      heapq.heappush(a, cb[j][0])
    else:
      break

print(sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
import heapq

tmp = list(map(int, input().split()))
n = tmp[0]
m = tmp[1]
a = list(map(int, input().split()))

ha = []
for i in range(n):
  heapq.heappush(ha, a[i])

for j in range(m):
  tmp = list(map(int, input().split()))
  b = tmp[0]
  c = tmp[1]

  for k in range(b):
    if ha[0] < c:
      heapq.heappop(ha)
      heapq.heappush(ha, c)
    else:
      break

print(sum(ha))  

Fixed submission:
import heapq

tmp = list(map(int, input().split()))
n = tmp[0]
m = tmp[1]
a = list(map(int, input().split()))

heapq.heapify(a)

cb = []
for j in range(m):
  tmp = list(map(int, input().split()))
  cb.append((tmp[1], tmp[0]))
cb.sort(reverse=True)

for j in range(m):
  if cb[j][0] < a[0]:
    break
  for k in range(cb[j][1]):
    if a[0] < cb[j][0]:
      heapq.heappop(a)
      heapq.heappush(a, cb[j][0])
    else:
      break

print(sum(a))

Buggy python submission (verdict: Runtime Error):
tmp = list(map(int, input().split()))
n = tmp[0]
m = tmp[1]
a = list(map(int, input().split()))

ha = []
for i in range(n):
  heapq.heappush(ha, a[i])

for j in range(m):
  tmp = list(map(int, input().split()))
  b = tmp[0]
  c = tmp[1]

  for k in range(b):
    if ha[0] < c:
      heapq.heappop(ha)
      heapq.heappush(ha, c)
    else:
      break

print(sum(ha))  

Fixed submission:
import heapq

tmp = list(map(int, input().split()))
n = tmp[0]
m = tmp[1]
a = list(map(int, input().split()))

heapq.heapify(a)

cb = []
for j in range(m):
  tmp = list(map(int, input().split()))
  cb.append((tmp[1], tmp[0]))
cb.sort(reverse=True)

for j in range(m):
  if cb[j][0] < a[0]:
    break
  for k in range(cb[j][1]):
    if a[0] < cb[j][0]:
      heapq.heappop(a)
      heapq.heappush(a, cb[j][0])
    else:
      break

print(sum(a))
Buggy python submission (verdict: Runtime Error):
bw = [0] * (n + 1)

n = int(input())
tmp = list(map(int, input().split()))
u = tmp[0]
v = tmp[1]
w = tmp[2]

bw[u] = -1
if w % 2 == 0:
  bw[v] = -1
else:
  bw[v] = 1

for i in range(1,n-1):
  tmp = list(map(int, input().split()))
  u = tmp[0]
  v = tmp[1]
  w = tmp[2]

  if w%2 == 0:
    jdg = 1
  else:
    jdg = -1

  if bw[u] != 0:
      bw[v] = bw[u] * jdg
  else:
      bw[u] = bw[v] * jdg

for i in range(1,n+1):
  if bw[i] == -1:
    print('0')
  else:
    print('1')

Fixed submission:
n = int(input())
bw = [0] * (n + 1)
uvw = [[] for _ in range (n+1)]

for i in range(0,n-1):
  tmp = list(map(int, input().split()))
  uvw[tmp[0]].append((tmp[1], tmp[2]))
  uvw[tmp[1]].append((tmp[0], tmp[2]))

#print(uvw)

nxt = [1]
bw[1] = 1

while len(nxt) != 0:
  cur = nxt.pop()
  while len(uvw[cur]) > 0:
    tmp = uvw[cur].pop()
    if tmp[1] % 2 == 0:
      jdg = 1
    else:
      jdg = -1

    if bw[tmp[0]] == 0:
#      print ('ADD NXT=' + str(tmp[0]) + ' JUDGE=' + str(jdg))
      bw[tmp[0]] = bw[cur] * jdg
      nxt.append(tmp[0])

for i in range(1,n+1):
  if bw[i] == -1:
    print('0')
  else:
    print('1')

Buggy python submission (verdict: Runtime Error):
bw = [0] * (n + 1)

n = int(input())
tmp = list(map(int, input().split()))
u = tmp[0]
v = tmp[1]
w = tmp[2]

bw[u] = -1
if w % 2 == 0:
  bw[v] = -1
else:
  bw[v] = 1

for i in range(1,n-1):
  tmp = list(map(int, input().split()))
  u = tmp[0]
  v = tmp[1]
  w = tmp[2]

  if w%2 == 0:
    jdg = 1
  else:
    jdg = -1

  if bw[u] != 0:
      bw[v] = bw[u] * jdg
  else:
      bw[u] = bw[v] * jdg

for i in range(1,n+1):
  if bw[i] == -1:
    print(0)
  else:
    print(1)

Fixed submission:
n = int(input())
bw = [0] * (n + 1)
uvw = [[] for _ in range (n+1)]

for i in range(0,n-1):
  tmp = list(map(int, input().split()))
  uvw[tmp[0]].append((tmp[1], tmp[2]))
  uvw[tmp[1]].append((tmp[0], tmp[2]))

#print(uvw)

nxt = [1]
bw[1] = 1

while len(nxt) != 0:
  cur = nxt.pop()
  while len(uvw[cur]) > 0:
    tmp = uvw[cur].pop()
    if tmp[1] % 2 == 0:
      jdg = 1
    else:
      jdg = -1

    if bw[tmp[0]] == 0:
#      print ('ADD NXT=' + str(tmp[0]) + ' JUDGE=' + str(jdg))
      bw[tmp[0]] = bw[cur] * jdg
      nxt.append(tmp[0])

for i in range(1,n+1):
  if bw[i] == -1:
    print('0')
  else:
    print('1')
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

ra = math.ceil(a / 10) * 10 - a
rb = math.ceil(b / 10) * 10 - b
rc = math.ceil(c / 10) * 10 - c
rd = math.ceil(d / 10) * 10 - d
re = math.ceil(e / 10) * 10 - e

ans = a + b + c + d + e + ra + rb + rc + rd + re - max(ra, rb, rc, rd, re)

print(ans)

Fixed submission:
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

ra = math.ceil(a / 10) * 10 - a
rb = math.ceil(b / 10) * 10 - b
rc = math.ceil(c / 10) * 10 - c
rd = math.ceil(d / 10) * 10 - d
re = math.ceil(e / 10) * 10 - e

ans = a + b + c + d + e + ra + rb + rc + rd + re - max(ra, rb, rc, rd, re)

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

neck = min(a,b,c,d,e)

cnt = 5 + math.ceil(n / neck) - 1

print(cnt)

Fixed submission:
import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

neck = min(a,b,c,d,e)

cnt = 5 + math.ceil(n / neck) - 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
tgt_b = int(str_in[2])
tgt_c = int(str_in[3])

source = [int(input()) for i in range(num)]

mp = float('inf')

for i in range(1,2**num):

  sum_a = 0
  len_a = 0
  
  bin_i = format(i,'0256b')  
  for t in range(1,num+1):
    sum_a += int(bin_i[-t])
    len_a += int(bin_i[-t]) * source[t-1]
    
  for j in range(1,2**num):
 
    sum_b = 0
    len_b = 0

    if (i & j) > 0:
      continue
    
    bin_j = format(j,'0256b')
    for t in range(1,num+1):
      sum_b += int(bin_j[-t])
      len_b += int(bin_j[-t]) * source[t-1]

    for k in range(1,2**num):

      sum_c = 0
      len_c = 0
      
      if (i & k) > 0:
        continue
      elif(j & k) > 0:
        continue
        
      bin_k = format(k,'08b')        
      
      for t in range(1,num+1):
        sum_c += int(bin_k[-t])
        len_c += int(bin_k[-t]) * source[t-1]
        
      mp_try = abs(len_a - tgt_a) + abs(len_b - tgt_b) + abs(len_c - tgt_c) + (sum_a + sum_b + sum_c - 3) * 10 
      if(mp > mp_try):
        mp = mp_try

print (mp)


Fixed submission:
str_in = input().split()
num   = int(str_in[0])
tgt_a = int(str_in[1])
tgt_b = int(str_in[2])
tgt_c = int(str_in[3])

source = [int(input()) for i in range(num)]

mp = float('inf')

for i in range(1,2**num):

  sum_a = 0
  len_a = 0
  
  bin_i = format(i,'08b')  
  for t in range(1,num+1):
    sum_a += int(bin_i[-t])
    len_a += int(bin_i[-t]) * source[t-1]
    
  for j in range(1,2**num):
 
    sum_b = 0
    len_b = 0

    if (i & j) > 0:
      continue
    
    bin_j = format(j,'08b')
    for t in range(1,num+1):
      sum_b += int(bin_j[-t])
      len_b += int(bin_j[-t]) * source[t-1]

    for k in range(1,2**num):

      sum_c = 0
      len_c = 0
      
      if (i & k) > 0:
        continue
      elif(j & k) > 0:
        continue
        
      bin_k = format(k,'08b')        
      
      for t in range(1,num+1):
        sum_c += int(bin_k[-t])
        len_c += int(bin_k[-t]) * source[t-1]
        
      mp_try = abs(len_a - tgt_a) + abs(len_b - tgt_b) + abs(len_c - tgt_c) + (sum_a + sum_b + sum_c - 3) * 10 
      if(mp > mp_try):
        mp = mp_try

print (mp)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = tuple(map(int, input().split()))
 
Y = X[::-1]
 
li = set(range(N))
 
for k in li:
    try:
        i = Y.index(k+1)
        Y = Y[:i]
    except:
        i = -1
        leng = k
        break
    leng = k + 1

if leng == 0:
    ans = -1
else:
    ans = N - leng
print(ans)

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

c = 0
for x in X:
    if x == c+1:
        c+=1
if c == 0:
    ans = -1
else:
    ans = N-c
print(ans)

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

Y = X[::-1]

li = set(range(N))

for k in li:
    print(Y)
    try:
        i = Y.index(k+1)
        Y = Y[:i]
    except:
        i = -1
        leng = k
        break
    leng = k + 1

if leng == 0:
    ans = -1
else:
    ans = N - leng
print(ans)


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

c = 0
for x in X:
    if x == c+1:
        c+=1
if c == 0:
    ans = -1
else:
    ans = N-c
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = tuple(map(int, input().split()))
Y = X[::-1]
for k in range(N):
    try:
        i = Y.index(k+1)
        Y = Y[:i]
    except:
        i = -1
        leng = k
        break
    leng = k + 1
if leng == 0:
    ans = -1
else:
    ans = N - leng
print(ans)

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

c = 0
for x in X:
    if x == c+1:
        c+=1
if c == 0:
    ans = -1
else:
    ans = N-c
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = list(map(int, input().split()))

Y = X[::-1]
Y = tuple(Y)

for k in range(N):
    try:
        i = Y.index(k+1)
        Y = Y[:i]
    except:
        i = -1
        leng = k
        break
    leng = k + 1

if leng == 0:
    ans = -1
else:
    ans = N - leng
print(ans)

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

c = 0
for x in X:
    if x == c+1:
        c+=1
if c == 0:
    ans = -1
else:
    ans = N-c
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

import math
g = math.gcd(A, B)


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

fac = factorization(g)
if fac[0][0] == 1:
    ans = 1
else:
    ans = len(fac)+1
print(ans)


Fixed submission:
A, B = map(int, input().split())
import fractions
g = fractions.gcd(A,B)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

fac = factorization(g)
fac

if fac[0][0] == 1:
    ans = 1
else:
    ans = len(fac)+1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
a = [int(input()) for i in range(Q)]
score = [a.count(x) for x in range(1, N+1)]
yn = ['No', 'Yes']

ans = [yn[min(1,max(K+x-Q,0))] for x in score]

for y in ans:
    print(y)

Fixed submission:
N, K, Q = map(int, input().split())
a = [int(input()) for i in range(Q)]

score = [0 for i in range(N)]
for x in a:
    score[x-1] += 1

yn = ['No', 'Yes']
ans = [yn[min(1,max(K+x-Q,0))] for x in score]

for y in ans:
    print(y)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = a.copy()

for i in range(m):
    b.sort(reverse=True)
    b[0] = b[0]//2
ans = sum(b)
print(ans)

Fixed submission:
# https://juppy.hatenablog.com/entry/2018/11/08/%E8%9F%BB%E6%9C%AC_python_%E3%83%97%E3%83%A9%E3%82%A4%E3%82%AA%E3%83%AA%E3%83%86%E3%82%A3%E3%82%AD%E3%83%A5%E3%83%BC_heapq_%E7%AB%B6%E6%8A%80%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3
n, m = map(int, input().split())
a = list(map(int, input().split()))
A = [-int(x) for x in a]

import heapq
heapq.heapify(A)

for i in range(m):
    y = heapq.heappop(A)
    heapq.heappush(A, -(-y//2))
    
print(-sum(A))
Buggy python submission (verdict: Runtime Error):
k, a, b = map(int, input().split())
ans = 0
def sousa(t, bis): # 残りターン数、所持ビスケット数、所持金はゼロまで全部買った後
    req = max(a - bis, 0) + 2 # 売買に必要なターン数
    # print(t, bis, req)
    if t< req: # 残りターン不足
        print(bis + t)
        return 
    elif req >= b - a: # 売買の成果が叩く成果以下なら売買する意味なし
        print(bis + t)
        return bis + t
    else: # 売買する
        sousa(t - req, bis + ((req - 2) - a + b)) # 売買の結果
import sys
sys.setrecursionlimit(500000)
sousa(k, 1)

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

def uru(t, bis): # すぐ売れるとき
    c = min(t, int(bis/a)*2) # 売り買いの回数
    return int(c/2)*2, bis + (b - a)*int(c/2)

def sousa(t, bis): # 残りターン数、所持ビスケット数、所持金はゼロまで全部買った後
    req = max(a - bis, 0) + 2 # 売買に必要なターン数
    # print(t, bis, req)
    if t< req: # 残りターン不足
        print(bis + t)
        return 
    elif req >= b - a + (req - 2): # 売買の成果が叩く成果以下なら売買する意味なし
        print(bis + t)
        return
    elif bis > a: # すぐ売れるとき
        sousa(t - uru(t, bis)[0], uru(t, bis)[1])
    else: # 売買する
        sousa(t - req, bis + ((req - 2) - a + b)) # 売買の結果

import sys
sys.setrecursionlimit(5000000)
sousa(k, 1)
Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
import math
g = 1
if N ==1:
    print(P)
else:
    for i in range(1,math.ceil(P**(1/N))+1):
        X = i**N
        if X > P:
            break
        else:
            if P % X == 0:
                g = i
    print(g)

Fixed submission:
N, P = map(int, input().split())
import math
g = 1
if N ==1:
    print(P)
else:
    for i in range(1,int((P+1)**(1/N))+1):
        X = i**N
        if X > P:
            break
        else:
            if P % X == 0:
                g = i
    print(g)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
li = [1]
if N ==1:
    li.append(P)
    print(max(li))
else:
    for i in range(1,int(P**(1/N))+2):
        X = i**N
        if X > P:
            break
        else:
            if P % X == 0:
                li.append(i)
    print(max(li))

Fixed submission:
N, P = map(int, input().split())
import math
g = 1
if N ==1:
    print(P)
else:
    for i in range(1,int((P+1)**(1/N))+1):
        X = i**N
        if X > P:
            break
        else:
            if P % X == 0:
                g = i
    print(g)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())

li = [1]
if N ==1:
    li.append(P)
else:
    for i in range(1,int(P**(1/N))+3):
        X = i**N
        if X > P:
            break
        else:
            if P % X == 0:
                li.append(i)
            else: pass

print(max(li))

Fixed submission:
N, P = map(int, input().split())
import math
g = 1
if N ==1:
    print(P)
else:
    for i in range(1,int((P+1)**(1/N))+1):
        X = i**N
        if X > P:
            break
        else:
            if P % X == 0:
                g = i
    print(g)
Buggy python submission (verdict: Runtime Error):
N = input()

li = []
for v in itertools.product('0357', repeat=len(N)):
    a = ''
    for w in v:
        a = a + w
    li.append(a)

li2 = []
for v in li:
    if '3' in v and '5' in v and '7' in v and int(v) <= int(N):
        v = v.replace('0', '')
        li2.append(v)
    else: pass
print(len(set(li2)))

Fixed submission:
N = input()
import itertools
li = []
for v in itertools.product('0357', repeat=len(N)):
    a = ''
    for w in v:
        a = a + w
    li.append(a)

li2 = []
for v in li:
    if '3' in v and '5' in v and '7' in v and int(v) <= int(N):
        v = v.replace('0', '')
        li2.append(v)
    else: pass
print(len(set(li2)))
Buggy python submission (verdict: Runtime Error):
import sys
a = sys.stdin.readlines()

if a[0] == 1:
    print('Hello World')
else:
    print(sum(a[1:]))

Fixed submission:
N = int(input())

if N == 1:
    print('Hello World')
else:
    A = int(input())
    B = int(input())
    print(A+B)

Buggy python submission (verdict: Runtime Error):
N = input()
if N == 1:
    print('Hello World')
else:
    AB = [int(input()) for i in range(2)]
    print(sum(AB))

Fixed submission:
N = int(input())

if N == 1:
    print('Hello World')
else:
    A = int(input())
    B = int(input())
    print(A+B)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000000)
N, Y = map(int, input().split())
y = Y//1000
li = [[10*a+5*b+(N - a - b), a, b, N- a-b] for a in range(N+1) for b in range(N+1-a) if 10*a+5*b+(N - a - b) == y]
if len(li) == 0:
    print('-1 -1 -1')
else:
    x = li[0]
    print(f'{x[1]} {x[2]} {x[3]}')

Fixed submission:
N, Y = map(int, input().split())
li = [[10*a+5*b+(N - a - b), a, b, N- a-b] for a in range(N+1) for b in range(N+1-a) if 10*a+5*b+(N - a - b) == Y//1000]
if len(li) == 0:
    print('-1 -1 -1')
else:
    x = li[0]
    print('{} {} {}'.format(x[1], x[2], x[3]))

Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
li = [[10*a+5*b+(N - a - b), a, b, N- a-b] for a in range(N+1) for b in range(N+1-a) if 10*a+5*b+(N - a - b) == Y//1000]
if len(li) == 0:
    print('-1 -1 -1')
else:
    x = li[0]
    print(f'{x[1]} {x[2]} {x[3]}')

Fixed submission:
N, Y = map(int, input().split())
li = [[10*a+5*b+(N - a - b), a, b, N- a-b] for a in range(N+1) for b in range(N+1-a) if 10*a+5*b+(N - a - b) == Y//1000]
if len(li) == 0:
    print('-1 -1 -1')
else:
    x = li[0]
    print('{} {} {}'.format(x[1], x[2], x[3]))

Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
li = [[10*a+5*b+(N - a - b), a, b, N- a-b] for a in range(N+1) for b in range(N+1-a)]
hantei = 0
for x in li:
    if x[0] == Y//1000:
        print(f'{x[1]} {x[2]} {x[3]}')
        hantei =1
        break
    else:
        pass
if hantei == 0:
    print('-1 -1 -1')

Fixed submission:
N, Y = map(int, input().split())
li = [[10*a+5*b+(N - a - b), a, b, N- a-b] for a in range(N+1) for b in range(N+1-a) if 10*a+5*b+(N - a - b) == Y//1000]
if len(li) == 0:
    print('-1 -1 -1')
else:
    x = li[0]
    print('{} {} {}'.format(x[1], x[2], x[3]))
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
li = []
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if z == s - (x + y):
                li.append('{} {} {}'.format(x, y, z))
li
print(len(set(li)))

Fixed submission:
k, s = map(int, input().split())
li = []
a=0
for x in range(k+1):
    for y in range(k+1):
            if 0 <= s - (x + y) <= k:
                a += 1
a
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
j=0
c=0
for i in range(len(a)):
    if(int(a[j])!=j+1):
        del(a[j])
        c+=1
    else:
        j+=1
if(n==c):
    print(-1)
else:
    print(c)

Fixed submission:
n = int(input())
a = input().split()
j=0
c=0
for i in range(len(a)):
    if(int(a[i])!=j+1):
        c+=1
    else:
        j+=1
if(n==c):
    print(-1)
else:
    print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

j=0
c=0
for i in range(len(a)):
    if(a[j]!=j+1):
        del(a[j])
        c+=1
    else:
        j+=1
if(n==c):
    print(-1)
else:
    print(c)


Fixed submission:
n = int(input())
a = input().split()
j=0
c=0
for i in range(len(a)):
    if(int(a[i])!=j+1):
        c+=1
    else:
        j+=1
if(n==c):
    print(-1)
else:
    print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = 10
su = 0
while p <= n:
   su += math.floor(n//p)
   p*=5

if n%2==1:
    print(0)
else:
    print(su)

Fixed submission:
n = int(input())
p = 10
su = 0
while p <= n:
   su += n//p
   p*=5

if n%2==1:
    print(0)
else:
    print(su)
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q=map(int,input().split())
point=[k for i in range(n)]
for i in range(q):
    point=[i-1 for i in point]
    point[int(input())-1]+=1        
for i in point:
    if(i>0):
        print("Yes")
    else:
        print("No")

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

Buggy python submission (verdict: Time Limit Exceeded):
n,k,q=map(int,input().split())
point=[k for i in range(n)]
for i in range(q):
    for i in range(n):
        point[i]-=1
    point[int(input())-1]+=1        
for i in point:
    if(i>0):
        print("Yes")
    else:
        print("No")

Fixed submission:
n,k,q=map(int,input().split())
a=[0 for i in range(n)]
for i in range(q):
    a[int(input())-1]+=1
for i in a:
    if k-q+i>0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
import sys
import math
input  = sys.stdin.readline


def solve():
    A,B = map(int,input().strip().split())
    print( int((A * B) / math.gcd(A, B)) )


if __name__ == '__main__':
    solve()


Fixed submission:
import sys
import fractions
input  = sys.stdin.readline


def solve():
    A,B = map(int,input().strip().split())
    print( int((A * B) / fractions.gcd(A, B)) )


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
A,B = map(int,input().split())
chk=0
for i in range(A, B+1):
  chk = chk ^ i
print(chk)


Fixed submission:
import sys
input = sys.stdin.readline
A,B = map(int,input().split())

def hoge(N):
  tmp = N//2
  if N%2 == 1:
    tmp+=1
    last=0
  else:
    last=N
  if tmp%2 == 1:
    return last+1
  else:
    return last

print(hoge(A-1) ^ hoge(B))
Buggy python submission (verdict: Runtime Error):
S = input()

c0=0
c1=0
for i in S:
  if i == '0':
    c0+=1
  elif:
    c1+=1

print(2*min(c0,c1))


Fixed submission:
S = input()

c0=0
c1=0
for i in S:
  if i == '0':
    c0+=1
  else:
    c1+=1

print(2*min(c0,c1))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input  = sys.stdin.readline

S = input()
N = len(S)

while True:
  n = len(S)
  S = S.replace('110100','')
  S = S.replace('001011','')
  S = S.replace('111000','')
  S = S.replace('000111','')
  S = S.replace('1010','')
  S = S.replace('0101','')
  S = S.replace('1100','')
  S = S.replace('0011','')
  S = S.replace('10','')
  S = S.replace('01','')
  if n == len(S):
    break
print(N-len(S))


Fixed submission:
S = input()

c0=0
c1=0
for i in S:
  if i == '0':
    c0+=1
  else:
    c1+=1

print(2*min(c0,c1))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input  = sys.stdin.readline

S = input()
N = len(S)

while True:
  n = len(S)
  S = S.replace('10','')
  S = S.replace('01','')
  if n == len(S):
    break
print(N-len(S))


Fixed submission:
S = input()

c0=0
c1=0
for i in S:
  if i == '0':
    c0+=1
  else:
    c1+=1

print(2*min(c0,c1))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input  = sys.stdin.readline

S = input()
N = len(S)

while True:
  n = len(S)
  S = S.replace('10','')
  if n == len(S):
    break
while True:
  n = len(S)
  S = S.replace('01','')
  if n == len(S):
    break
print(N-len(S))


Fixed submission:
S = input()

c0=0
c1=0
for i in S:
  if i == '0':
    c0+=1
  else:
    c1+=1

print(2*min(c0,c1))