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

Fixed submission:
# coding: utf-8

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

count = 0
imp = 0

while True:
    for i in range(0, N):
        if int(A[i]) % 2 == 1:
            imp = 1
            break

    if imp == 1:
        break

    for i in range(0, N):
        A[i] = int(A[i] / 2)
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

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

c = 0
count = 0
imp = 0

while imp == 0:
    for i in range(0..N+1):
        if A[i] % 2 == 0:
            c += 1
            continue
        else:
            imp = 1
            break

    if c == N and imp == 0:
        for i in range(0..N+1):
            A[i] = int(A[i] / 2)
            count += 1

print(count)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
print(a*b)
Problem p02730 (python)

Fixed submission:
def kaibun(s):
  n=len(s)
  a=True
  if n%2==0:
    for i in range(n//2):
      if s[i]!=s[n-1-i]:
        a=False
  else:
    for i in range((n-1)//2):
      if s[i]!=s[n-1-i]:
        a=False
  return a
S=input()
N=len(S)
if kaibun(S)==True and kaibun(S[0:(N-1)//2])==True and kaibun(S[(N+3)//2-1:N])==True:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
def kaibun(s):
  n=len(s)
  a=True
  if n%2==0:
    for i in range(n/2):
      if s[i]!=s[n-1-i]:
        a=False
  else:
    for i in range((n-1)/2):
      if s[i]!=s[n-1-i]:
        a=False
  return a
S=input()
N=len(S)
if kaibun(S)==True and kaibun(S[0:(N-1)/2])==True and kaibun(S[(N+3)/2-1:N])==True:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
def kaibun(s):
  n=len(s)
  a=True
  if n%2==0:
    for i in range(n/2):
      if s[i]!=s[n-1-i]:
        a=False
  else:
    for i in range((n-1)/2):
      if s[i]!=s[n-1-i]:
        a=False
  return a
if kaibun(S)==True and kaibun(S[0:(len(S)-1)/2])==True and kaibun(S[(len(S)+3)/2-1:len(S)])==True:
  return "Yes"
else:
  return "No"
Problem p02731 (python)

Fixed submission:
L=int(input())
print((L/3)**3)

Buggy submission (verdict: Runtime Error):
print((L/3)**3)

Buggy submission (verdict: Runtime Error):
(L/3)**3
Problem p02574 (python)

Fixed submission:
import math
N = int(input())
num = list(map(int, input().split()))
#N = 10**6
#num = list(range(1, N+1))

MAXX = 10**6 + 1
MAXZ = int(math.sqrt(MAXX)+2)
furui = [[] for _ in range(MAXX)]

furui[1].append(1)
count = [0]*MAXX
for i in range(2, MAXX):
    if len(furui[i]) == 0:
        for k in range(i, MAXX, i):
            furui[k].append(i)

setwise = True
pairwise = True
for i in range(N):
    if not setwise and not pairwise: break
    for fu in furui[num[i]]:
        count[fu] += 1
        if fu > 1 and count[fu] >= N:
            setwise = False
            pairwise = False
            break
        elif fu > 1 and count[fu] > 1:
            pairwise = False

if pairwise:
    print('pairwise coprime')
elif setwise:
    print('setwise coprime')
else:
    print('not coprime')

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

MAXX = 10**6 + 1
MAXZ = int(math.sqrt(MAXX)+1)
furui = [[] for _ in range(MAXZ)]

furui[1].append(1)
count = [0]*MAXX
for i in range(2, MAXZ):
    if len(furui[i]) == 0:
        for k in range(i, MAXZ, i):
            furui[k].append(i)

setwise = True
pairwise = True
for i in range(N):
    if not setwise and not pairwise: break
    for fu in furui[num[i]]:
        count[fu] += 1
        if count[fu] >= N:
            setwise = False
            pairwise = False
            break
        elif count[fu] > 1:
            pairwise = False

if pairwise:
    print('pairwise coprime')
elif setwise:
    print('setwise coprime')
else:
    print('not coprime')

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

MAXX = 10**6 + 1
MAXZ = int(math.sqrt(MAXX)+1)
furui = [[] for _ in range(MAXZ)]

furui[1].append(1)
count = [0]*MAXX
for i in range(2, MAXZ):
    if len(furui[i]) == 0:
        for k in range(i, MAXZ, i):
            furui[k].append(i)

setwise = True
pairwise = True
for i in range(N):
    if not setwise and not pairwise: break
    for fu in furui[num[i]]:
        count[fu] += 1
        if count[fu] >= N:
            setwise = False
            pairwise = False
            break
        elif count[fu] > 1:
            pairwise = False

if pairwise:
    print('pairwise coprime')
elif setwise:
    print('setwise coprime')
else:
    print('not coprime')

Buggy submission (verdict: Runtime Error):
from math import sqrt
N = int(input())
num = list(map(int, input().split()))

MAXX = 10**6 + 1
MAXZ = int(sqrt(MAXX)+1)
furui = [[] for _ in range(MAXZ)]

furui[1].append(1)
count = [0]*MAXX
for i in range(2, MAXZ):
    if len(furui[i]) == 0:
        for k in range(i, MAXZ, i):
            furui[k].append(i)

setwise = True
pairwise = True
for i in range(N):
    if not setwise and not pairwise: break
    for fu in furui[num[i]]:
        count[fu] += 1
        if count[fu] >= N:
            setwise = False
            pairwise = False
            break
        elif count[fu] > 1:
            pairwise = False

if pairwise:
    print('pairwise coprime')
elif setwise:
    print('setwise coprime')
else:
    print('not coprime')
Problem p02642 (python)

Fixed submission:
import numpy as np

N = int(input())
MAXX = 10**6 + 5
num = np.array(input().split(), np.int32)[:]
mark = np.zeros(MAXX, np.int32)

num = np.sort(num)
for n in num:
    if mark[n] < 2:
        mark[n::n] += 1

count = 0
for n in num:
    if mark[n] == 1:
        count += 1

print(count)

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

N = int(input())
MAXX = 10**6 + 5
num = np.array(input().split(), np.int32)[:]
mark = np.zeros(MAXX, np.int32)

num = np.sort(num)
for n in num:
    if mark[n::n] < 2:
        mark[n::n] += 1

count = 0
for n in num:
    if mark[n] == 1:
        count += 1

print(count)
Problem p02665 (python)

Fixed submission:
import math
#3
#0 1 1 2

N = int(input())+1
leaves = list(map(int, input().split()))

nod = 0
total = 0

maxx = [0]*(N+1)
#toward
maxx[0] = 1
if N == 1 and leaves[0] == 1:
    total = 1
else:
    for i in range(1, N):
        notleave = maxx[i-1] - leaves[i-1]
        if notleave <= 0:
            total = -1
            break
        maxx[i] = notleave*2
        if maxx[i] < leaves[i]:
            total = -1
            break
        # if i == N-1:
        #     total += leaves[i]
        # else:
        #     total += maxx[i]



    #backward
    for i in range(1, N+1):
        ii = N-i
        #at least need newnod nodes
        newnod = int((nod+1)/2) + leaves[ii]
        if newnod > maxx[ii]:
            total = -1
            break
        #maximum is?
        newnod = nod + leaves[ii]
        if newnod > maxx[ii]: newnod = maxx[ii]
        if newnod <= 0:
            total = -1
            break
        total += newnod
        nod = newnod


if total <= 0: total = -1
print(total)

Buggy submission (verdict: Runtime Error):
#3
#0 1 1 2

N = int(input())+1
leaves = list(map(int, input().split()))

nod = 0
total = 0

maxx = [0]*(N+1)
#toward
maxx[0] = 1
for i in range(1, N+1):
    notleave = maxx[i-1] - leaves[i-1]
    maxx[i] = notleave*2

#backward
for i in range(1, N+1):
    ii = N-i
    #at least need newnod nodes
    newnod = int((nod+1)/2) + leaves[ii]
    if newnod > 2**ii:
        total = -1
        break
    #maximum is?
    newnod = nod + leaves[ii]
    if newnod > maxx[ii]: newnod = maxx[ii]
    total += newnod
    nod = newnod

print(total)
Problem p02732 (python)

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

#N = 200000
#A = [200000]*N

count = [0]*(N+2)
for i in range(N):
    id = A[i]
    count[id] = count[id]+1

sumN = long(0)
for i in range(N+1):
    sumN = sumN + long(long(count[i]*(count[i]-1))/2)

#print answer
for i in range(N):
    id = A[i]
    sumz = sumN - (count[id] - 1)
    print(sumz)

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
A = map(int, raw_input().split())
 
#N = 200000
#A = [200000]*N
 
count = [0]*(N+2)
for i in range(N):
    id = A[i]
    count[id] = count[id]+1
 
sumN = long(0)
for i in range(N+1):
    sumN = sumN + long(long(count[i]*(count[i]-1))/2)
 
#print answer
for i in range(N):
    id = A[i]
    sumz = sumN - (count[id] - 1)
    print(sumz)
Problem p03087 (python)

Fixed submission:

N, Q = map(int, input().split())
S = input().rstrip('\n')
count = [0]*(N+2)

for i in range(N-1):
    if S[i] == 'A' and S[i+1] == 'C':
        count[i+1] = 1

#累積和
for i in range(1, N+1):
    count[i] += count[i-1]

for _ in range(Q):
    l, r = map(int, input().split())
    print(count[r-1] - count[l-1])

Buggy submission (verdict: Runtime Error):

N, Q = map(int, input().split())
S = input().rstrip('\n')
count = [0]*(N+2)

for i in range(N):
    if S[i] == 'A' and S[i+1] == 'C':
        count[i+1] = 1

#累積和
for i in range(1, N+1):
    count[i] += count[i-1]

for _ in range(Q):
    l, r = map(int, input().split())
    print(count[r-1] - count[l-1])

Buggy submission (verdict: Runtime Error):

N, Q = map(int, input().split())
S = input().rstrip('\n')
count = [0]*(N+1)

for i in range(N):
    if S[i] == 'A' and S[i+1] == 'C':
        count[i+1] = 1

#累積和
for i in range(1, N+1):
    count[i] += count[i-1]

for _ in range(Q):
    l, r = map(int, input().split())
    print(count[r-1] - count[l-1])
Problem p03363 (python)

Fixed submission:
import numpy as np
N = int(input())
num = list(map(int, input().split()))

sumz = np.zeros(N+1, dtype=int)
count = np.zeros(N+1, dtype=int)
for i in range(1, N+1):
    sumz[i] = sumz[i-1] + num[i-1]

sortedsumz = np.sort(sumz)

def CC(a, b):
    ans = 1
    mulz = 1
    for i in range(b-a+1, b+1):
        ans *= i
    for i in range(1,a+1):
        mulz *= i
    return int(ans/mulz)

ways = 0
for i in range(1, N+1):
    if sortedsumz[i] == sortedsumz[i-1]:
        count[i] = count[i-1]+1
    elif count[i-1] >= 1:
        ways += CC(2, count[i-1]+1)

    #if sortedsumz[i-1] == 0:
    #    nzero += 1

if count[N] >= 1:
    ways += CC(2, count[N] + 1)
print(ways)

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

sumz = np.zeros(N+1, dtype=int)
count = np.zeros(N+1, dtype=int)
for i in range(1, N+1):
    sumz[i] = sumz[i-1] + num[i-1]

sortedsumz = np.sort(sumz)

def CC(a, b):
    ans = 1
    mulz = 1
    for i in range(b-a+1, b+1):
        ans *= i
    for i in range(1,a+1):
        mulz *= i
    return int(ans/mulz)

ways = 0
for i in range(1, N+1):
    if sortedsumz[i] == sortedsumz[i-1]:
        count[i] = count[i-1]+1
    elif count[i-1] >= 1:
        ways += CC(2, count[i-1]+1)

    #if sortedsumz[i-1] == 0:
    #    nzero += 1

if count[N] >= 1:
    ways += CC(2, count[N] + 1)
print(ways)
Problem p03372 (python)

Fixed submission:
import numpy as np
N, C = map(int, input().split())

xv = [(0, 0)]
for i in range(N):
    x, v = map(float, input().split())
    xv.append((x, v))

sumA = np.zeros(N+2, dtype=float)
sumB = np.zeros(N+2, dtype=float)

xv.sort(key=lambda tup:tup[0])
xv.append((C,0))

for i in range(N+1):
    sumA[i+1] = sumA[i] + xv[i+1][1]
    sumB[i+1] = sumB[i] + xv[N-i][1]

maxA = [0]*(N+1)
maxB = [0]*(N+1)
for i in range(N):
    if sumA[i+1] < xv[i+1][0]: sumA[i+1] = 0
    else: sumA[i+1] -= xv[i+1][0]
    if sumB[i+1] < C - xv[N-i][0]: sumB[i+1] = 0
    else: sumB[i+1] -= C - xv[N-i][0]

    maxA[i + 1] = maxA[i]
    if sumA[i+1] > maxA[i]:
        maxA[i+1] = sumA[i+1]
    maxB[i + 1] = maxB[i]
    if sumB[i+1] > maxB[i]:
        maxB[i+1] = sumB[i+1]

ans = 0
for i in range(N):
    #when to turn back?
    #valB = -xv[i][0] + max(sumB[:N-i+1])
    valB = -xv[i][0] + maxB[N - i]
    if valB < 0:
        ans = max(ans, sumA[i])
    else:
        ans = max(ans, sumA[i] + valB)

    #when to turn back?
    valA = -C+xv[N-i+1][0] + maxA[N-i]
    if valA < 0:
        ans = max(ans, sumB[i])
    else:
        ans = max(ans, sumB[i] + valA)

print(int(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
N, C = map(int, input().split())

xv = [(0, 0)]
for i in range(N):
    x, v = map(float, input().split())
    xv.append((x, v))
sumA = np.zeros(N+1, dtype=float)
sumB = np.zeros(N+1, dtype=float)

xv.sort(key=lambda tup:tup[0])
for i in range(N):
    sumA[i+1] = sumA[i] + xv[i+1][1]
    sumB[i+1] = sumB[i] + xv[N-i][1]

for i in range(N):
    if sumA[i+1] < xv[i+1][0]: sumA[i+1] = 0
    else: sumA[i+1] -= xv[i+1][0]
    if sumB[i+1] < C - xv[N-i][0]: sumB[i+1] = 0
    else: sumB[i+1] -= C - xv[N-i][0]

ans = 0
for i in range(N):
    #when to turn back?
    valB = -xv[i][0] + max(sumB[:N-i+1])
    if valB < 0:
        ans = max(ans, sumA[i])
    else:
        ans = max(ans, sumA[i] + valB)

print(int(ans))
Problem p02576 (python)

Fixed submission:
n, x, t = map(int, input().split())
if n % x == 0:
  print((n // x) * t)
else:
  print((n // x + 1) * t)

Buggy submission (verdict: Runtime Error):
n, x, t = map(int, input().split())
if n % x == 0:
  print((n // x) * t)
else:
  print(((n // x) + 1) * t
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())
a = []
for i in range(0, x+1):
  a.append(2 * i + 4 * (x - i))
print("Yes" if y in a else "No")

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
s = []
if n == 0:
  print(x)
else:
  a = sorted([i for i in list(map(int, input().split())) if i != x])
  for i in range(n):
    s.append(abs(a[i] - x))
  b = a[s.index(min(s))]
  print(b)

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
for i in range(0, x+1):
  a.append(2 * i + 4 * (3 - i))
print("Yes" if y in a else "No")
Problem p02658 (python)

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

ans = 1
for i in a :
  ans *= i
  if ans > 10**18 :
    ans = -1
    break
if 0 in a :
  ans = 0

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a:
  s *= i
  if s => 10 ** 18:
    s = -1
    break
if 0 in a:
  s = 0
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a:
  s *= i
  if s => 10 ** 18:
    s = -1
    break
if 0 in n:
  s = 0
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a:
  s *= i
  if s => 10 ** 8:
    s = -1
    break
if 0 in a:
  s = 0
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a:
  s *= i
  if s => 10 ** 8:
    s = -1
    break
if 0 in n:
  s = 0
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a:
  s *= i
  if s => 10 ** 8:
    ans = -1
    break
if 0 in n:
  ans = 0
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a:
  s *= i
  if s => 10 ** 8:
    print(-1)
    break
else:
  print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
    if 0 in a:
      print(0)
      exit()
    for i in a:
      if i >= 10 ** 8:
        print(-1)
        break
      s *= i
      if s >= 10 ** 8:
        print(-1)
        break
    else:
      print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
if 0 in a:
  print(0)
for i in a:
  if 
for i in a:
  if i >= 10 ** 8:
    print(-1)
    break
  s *= i
  if s >= 10 ** 8:
    print(-1)
    break
else:
  print(s)
Problem p02675 (python)

Fixed submission:
n = input()
n = int(n[len(n) -1])
a = [2, 4, 5, 7, 9]
b = [0, 1, 6, 8]

if n in a:
  print("hon")
elif n in b:
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
n = int(input()[len(n - 1)])
a = [2, 4, 5, 7, 9]
b = [0, 1, 6, 8]

if n in a:
  print("hon")
elif n in b:
  print("pon")
else:
  print("bon")
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
print("Yes" if s == t[:len(t) - 1] else "No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
print("Yes" if s == t[:-1] "No")
Problem p02760 (python)

Fixed submission:
s = " 012 345 678 036 147 258 048 246 "
a = [input().split() for i in range(3)]
b = a[0] + a[1] + a[2]

for i in [input()for i in range(int(input()))]:
  if i in b:
    s = s.replace(str(b.index(i)), "")
print("Yes" if "  " in s else "No")

Buggy submission (verdict: Runtime Error):
a = [list(map(int, input().split())) for i in range(3)]
n = int(input())
b = [i for i in range(n)]

for i in range(3):
  for j in range(3):
    if a[i][j] in b:
      a[i][j] == 0
print("Yes" if any(i.count(0) == 3 for i in a))
print("Yes" if any(i.count(0) == 3 for i in zip(*a)))
Problem p02772 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print("APPROVED" if all(i % 5 == 0 or i % 3 == 0 for i in a if i % 2 == 0) else "DENIED")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
print("APPROVED" if all(i % 5 == 0 or i % 3 == 0 for i in a if i % 2 == 0 else "DENIED")
Problem p02795 (python)

Fixed submission:
a = int(input())
b = int(input())
n = int(input())
t = max(a, b)
print((n + t - 1) // t)

Buggy submission (verdict: Runtime Error):
a, b, n = map(int, input().split())
print(n // a + 1 if a >= b else n // b + 1)
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print( t + s)

Buggy submission (verdict: Runtime Error):
s, t = input().split()
print(" ".join(t, s))
Problem p02844 (python)

Fixed submission:
n=int(input())
s=input()
ans=0
for i in range(10):
  idx1=s.find(str(i))
  for j in range(10):
    idx2=s.find(str(j),idx1+1,n)
    for k in range(10):
      idx3=s.find(str(k),idx2+1,n)
      if idx1==-1 or idx2==-1 or idx3==-1:
        continue
      else:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
a = {}
for i in range(n-2):
  for j in range(i+1, n-1):
    for k in range(j+1, n):
      a.append(s[i] + s[j] + s[k])
print(len(s))
Problem p02885 (python)

Fixed submission:
a, b = map(int, input().split())
print(a - (2 * b) if a > (2 * b) else 0)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(a - (2 * b) if a > 2b else 0)
Problem p02934 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in a:
  s += 1 / i
print(1 / s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in a:
  s += 1 / a
print(1 / s)
Problem p02988 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
t = 0
for i in range(1, n-1):
  if sorted(a[i-1:i+2]).index(a[i]) == 1:
    t += 1
print(t)

Buggy submission (verdict: Runtime Error):
n, a* = map(int, open(0).read().split())
t = 0
for i in range(1, n-1):
  if sorted(a[i-1:i+2]).index(a[i]) == 1:
    t += 1
print(t)

Buggy submission (verdict: Runtime Error):
n, a* = map(int, open(0).read().split())
t = 0
for i in range(1, n-1):
  if sorted([i-1:i+2]).index(a[i]) == 1:
    t += 1
print(t)
Problem p02993 (python)

Fixed submission:
a = input()
print("Bad" if a[0] == a[1] or a[1] == a[2] or a[2] == a[3] else "Good")

Buggy submission (verdict: Runtime Error):
a = int(input())
print("Bad" if a[0] == a[1] or a[1] == a[2] or a[2] == a[3] else "Good")
Problem p02994 (python)

Fixed submission:
n, l = map(int, input().split())
a = sorted([l + i for i in range(n)], key=abs)
print(sum(a[1:]))

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
a = sorted([l + i for i in range(n)], key=abs)
print(sum(s[1:]))

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
a = sorted([l + i - 1 for i in range(1, n-1)])
print(sum(a) - a[0] if abs(a[0]) > abs(a[-1]) else sum(a) - a[-1])
Problem p03076 (python)

Fixed submission:
a = [int(input()) for i in range(5)]
b = [9 - (i - 1) % 10 for i in a]
print(sum(a) + sum(b) - max(b))

Buggy submission (verdict: Runtime Error):
b = []
a = [int(input()) for i in range(5)]
for i in a:
  if i % 10 != 0:
    b.append(10 - (i % 10))

print(sum(a) + sum(b) - max(b))

Buggy submission (verdict: Runtime Error):
a = [int(input()) for i in range(5)]
b = [10 - i % 10 for i in a if i % 10 != 0]
print(sum(a) + sum(b) - max(b))
Problem p03110 (python)

Fixed submission:
n = int(input())
a = 0
for i in range(n):
  v, c = input().split()
  v = float(v)
  if c == "JPY":
    a += v
  else:
    a += v * 380000.0
print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = 0
for i in range(n):
  v, c = map(int, input().split())
  if c == "JPY":
    a += v
  else:
    a += v * 380000.0
print(a)
Problem p03139 (python)

Fixed submission:
n, a, b = map(int, input().split())
print(min(a, b), max(0, (a + b) - n))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, raw_input().split())
m = A + B
print(min(A, B), max(0, m - N))
Problem p03146 (python)

Fixed submission:
s = int(input())
a = [s]
i = 1
while True:
  if s % 2 == 0:
    s = s // 2
  else:
    s = 3 * s + 1
  if s in a:
    print(len(a) + 1)
    break
  a.append(s)

Buggy submission (verdict: Runtime Error):
s = int(input())
a = [s]
while True:
  if s % 2 == 0:
    s = s // 2
  else:
    s = 3 * s + 1
  if s in a:
    print(s)
    break
  s.append(s)
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
b = [abs(a - (t - i * 0.006)) for i in list(map(int, input().split()))]
print(b.index(min(b)) + 1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = map(int, input().split())
b = [abs(a - (t - i * 0.006)) for i in list(map(int, input().split()))]
print(b.index(min(b) + 1))
Problem p03227 (python)

Fixed submission:
n = input()
print(n[::-1] if len(n) == 3 else n)

Buggy submission (verdict: Runtime Error):
n = input()
print(n.reverse() if len(n) == 3 else n)
Problem p03239 (python)

Fixed submission:
n, t = map(int, input().split())
a = []
for i in range(n):
  c, s = map(int, input().split())
  if s <= t:
    a.append(c)
print("TLE" if len(a) == 0 else min(a))

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
a = []
for i in range(n):
  c, s = map(int, input().split())
  if s <= t:
    a.append(c)
print(min(a))
Problem p03285 (python)

Fixed submission:
n = int(input())
print("Yes" if any((n - i*7) % 4 == 0 for i in range(n // 7 + 1)) else "No")

Buggy submission (verdict: Runtime Error):
n = int(input())
print("Yes" if any((n - i*7) % 4 == 0 for i in range(n // 7 + 1) else "No")
Problem p03293 (python)

Fixed submission:
s, t = [input() for i in range(2)]
for _ in range(len(s)):
  s = s[-1] + s[:-1]
  if s == t:
    print("Yes") 
    break
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s, t = [input() for i in range(2)]
for _ in range(len(s)):
  s = s[1:] + s[0]
  if s = t:
    print("Yes") 
    break
else:
  print("No")
Problem p03308 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
print(max(a) - min(a))
Problem p03323 (python)

Fixed submission:
a, b = map(int, input().split())
print("Yay!" if a <= 8 and b <= 8 else ":(")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print("Yay!" if a <= 8 and b <= 8 else: ":(")
Problem p03324 (python)

Fixed submission:
d, n = map(int, input().split())
print(n * (100 ** d) if n < 100 else (n + 1) * (100 ** d) )

Buggy submission (verdict: Runtime Error):
d, n = map(int, input().split())
a = []
for i in range(100 ** d, 100 ** (d + 1)):
  if i % (100 ** d) == 0:
    a.append(i)
print(a[n-1])
Problem p03338 (python)

Fixed submission:
n = int(input())
s = input()
a = []
for i in range(1, n):
  a.append(len(set(s[:i]) & set(s[i:])))
print(max(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
w = set(s)
t = 0
for i in range(n):
  if s.count(w[i]) >= 2:
    t += 1
print(t)