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

Fixed submission:
from collections import defaultdict

n, m= map(int, input().split())

links = [[] for x in range(n + 1)]
sums = [0 for x in range(n + 1)]
adds = [0 for x in range(n + 1)]

links[0].append(1)
for _ in range(n - 1):
  a, b= map(int, input().split())
  links[a].append(b)
  links[b].append(a)

for _ in range(m):
  p, x = map(int, input().split())
  adds[p] += x

# print(links)
que = [0,[1]]
checked = [0 for x in range(n+1)]

que = [[-1, [0]]]

while que:
  link = que.pop()
  # print(link)
  par = link[0]
  childs = link[1]

  for child in childs:
    if checked[child] != 1:
      sums[child] = sums[par] + adds[child]
      que.append([child, links[child]])
      checked[child] = 1

  
print(*sums[1:])

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

n, m= map(int, input().split())

links = []

sums = np.zeros(n + 1)

oya = {}

for _ in range(n - 1):
  a, b= map(int, input().split())
  oya[b] = a
  heapq.heappush(links, [a, b])

uppers = np.eye(n + 1)

for l in links:
  oyaId = l[0]
  koId = l[1]
  uppers[oyaId, koId] = 1
  while True: 
    if oyaId in oya:
      uppers[oyaId, koId] = 1
      oyaId = oya[oyaId]
    else:
      uppers[oyaId, koId] = 1
      break
      
for _ in range(m):
  p, x = map(int, input().split())
  sums += x * uppers[p, :]
print(*sums[1:].astype(np.int))

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

n, m= map(int, input().split())

links = []

sums = np.zeros(n + 1)

oya = {}

for _ in range(n - 1):
  a, b= map(int, input().split())
  oya[b] = a
  heapq.heappush(links, [a, b])

uppers = np.eye(n + 1)

for l in links:
  oyaId = l[0]
  koId = l[1]

  while True: 
    uppers[oyaId, koId] = 1
    if oyaId != 1:
      oyaId = oya[oyaId]
    else:
      break
      
for _ in range(m):
  p, x = map(int, input().split())
  sums += x * uppers[p, :]
print(*sums[1:].astype(np.int))

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

n, m= map(int, input().split())

links = []

sums = np.zeros(n + 1)

oya = {}

for _ in range(n - 1):
  a, b= map(int, input().split())
  oya[b] = a
  heapq.heappush(links, [a, b])

uppers = np.eye(n + 1)

for l in links:
  oyaId = l[0]
  koId = l[1]

  while True: 
    uppers[oyaId, koId] = 1
    if oyaId in oya:
      oyaId = oya[oyaId]
    else:
      break
# print(uppers)
# print(sums)
for _ in range(m):
  p, x = map(int, input().split())
  sums += x * uppers[p, :]
print(*sums[1:].astype(np.int))
Problem p02997 (python)

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

maxLinks = (n-1) * (n-2) // 2

if maxLinks < k:
  print(-1)
else:
  # とりあえず１を中心にしてぜんぶ出す
  links = [(1, x) for x in range(2, n+1)]
  linkNum_to_decrease = maxLinks - k
  num_cost_2 = maxLinks
  for i in range(2, n + 1):
    for j in range(i + 1, n + 1):
      #print(num_cost_2)
      if num_cost_2 == k:
   	    break
      else:
        links.append((i,j))
        num_cost_2 -= 1

  print(len(links))
  for link in links:
    print(link[0], link[1])

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

maxLinks = (n-1) * (n-2) // 2

if maxLinks < k:
  print(-1)
else:
  # とりあえず１を中心にしてぜんぶ出す
  links = [(1, x) for x in range(2, n+1)]
  linkNum_to_decrease = maxLinks - k
  num_cost_2 = maxLinks
  for i in range(2, n + 1):
    for j in range(i + 1, n + 1):
      #print(num_cost_2)
      if num_cost_2 == k:
   	    break
      else:
        links.append((i,j))
        num_cost_2 -= 1

print(len(links))
for link in links:
  print(link[0], link[1])

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

maxLinks = (n-1) * (n-2) // 2

if maxLinks < k:
  print(-1)
else:
  # とりあえず１を中心にしてぜんぶ出す
  links = [(1, x) for x in range(2, n+1)]
  linkNum_to_decrease = maxLinks - k
  num_cost_2 = maxLinks
  for i in range(2, n + 1):
    for j in range(i + 1, n + 1):
      #print(num_cost_2)
      if num_cost_2 == k:
   	    break
      else:
        links.append((i,j))
        num_cost_2 -= 1

#print(len(links))
for link in links:
  print(link[0], link[1])
Problem p02901 (python)

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

INF = int(10e8 + 1)
dp = [INF] * (1 << n)
dp[0] = 0

for j in range(m):
    cost = int(input().split()[0])

    boxes = [int(x)-1 for x in input().split()]
    mask = 0

    mask = sum(1 << box for box in boxes)
    
    for i in range(1 << n):
        if dp[i] + cost < dp[i | mask]:
            dp[i | mask] = dp[i] + cost

res = dp[-1] if dp[-1] != INF else -1
print(res)

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


n, m = [int(x) for x in input().split()]

costs = []
masks = []

for _ in range(m):
  costs.append(int(input().split()[0]))

  boxes = {int(x)-1 for x in input().split()}
  mask = ['1' if idx in boxes else '0' for idx in range(n)][::-1]
  mask = int(''.join(mask), 2)
  masks.append(mask)

  INF = int(10e8 + 1)
  #dp = np.full(1 << n, INF, dtype=int)
  dp = [INF] * (1 << n)
  dp[0] = 0

  for j in range(m):
    for i in range(1 << n):
      dp[i | masks[j]] = min(
        dp[i | masks[j]],
        dp[i] + costs[j]
      )

      res = dp[-1] if dp[-1] != INF else -1
      print(res)

Buggy submission (verdict: Runtime Error):
    import numpy as np
     
     
    n, m = [int(x) for x in input().split()]
     
    costs = []
    masks = []
     
    for _ in range(m):
        costs.append(int(input().split()[0]))
     
        boxes = {int(x)-1 for x in input().split()}
        mask = ['1' if idx in boxes else '0' for idx in range(n)][::-1]
        mask = int(''.join(mask), 2)
        masks.append(mask)
     
    INF = int(10e8 + 1)
    #dp = np.full(1 << n, INF, dtype=int)
    dp = [INF] * (1 << n)
    dp[0] = 0
     
    for j in range(m):
        for i in range(1 << n):
            dp[i | masks[j]] = min(
                    dp[i | masks[j]],
                    dp[i] + costs[j]
                )
     
    res = dp[-1] if dp[-1] != INF else -1
    print(res)
Problem p03079 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a==b:
  if b==c:
    if a==c:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a=b:
  if b=c:
    if a=c:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a=b=c:
  print('Yes')
else:
  print('No')
Problem p03102 (python)

Fixed submission:
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
num=0
A=[]
for i in range(N):
  A.append(list(map(int,input().split())))
D=[]
for j in range(N):
  sum=0
  D=A[j]
  for k in range(M):
    sum+=B[k]*D[k]
  if sum+C>0:
    num+=1
print(num)

Buggy submission (verdict: Runtime Error):
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
num=0
A=[]
for i in range(N):
  A.append(list(map(int,input().split())))
D=[]
for j in range(N):
  sum=0
  D=A[j]
  for k in range(M):
    sum+=B[j]*D[j]
  if sum+C>0:
    num+=1
print(num)

Buggy submission (verdict: Runtime Error):
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
num=0
for i in range(N):
  sum=0
  A=[]
  A.append(list(map(int,input().split())))
  for j in range(M):
    sum+=A[j] * B[j]
  if sum+C>0:
    num+=1
print(num)

Buggy submission (verdict: Runtime Error):
N,M,C=map(int,input().split())
B=list(int,input().split())
num=0
for i in range(N):
  sum=0
  A=[]
  A.append(list(map(int,input().split())))
  for j in range(M):
    sum+=A[j] * B[j]
  if sum+C >0:
    num+=1
print(num)

Buggy submission (verdict: Runtime Error):
N,M,C=map(int,input().split())
B=list(int,input().split())
num=0
for i in range(N):
  sum=0
  A=list(int,input().split())
  for j in range(M):
    sum+=A[j] * B[j]
  if sum+C >0:
    num+=1
print(num)
Problem p03146 (python)

Fixed submission:
s = int(input())
cnt = 1
box = set()
while not s in box:
	box.add(s)
	if s % 2 == 0:
		s = s / 2
	else:
		s = 3 * s + 1
	cnt += 1
	
print(cnt)

Buggy submission (verdict: Runtime Error):
s=int(input())
count=0
if s==1:
  print(4)
elif s==2:
  print(4)
else:
  for i in range(1000000):
  if s%2==0:
    s=s//2
    count+=1
    if s==4:
      break
  else:
    s=s*3+1
    count+=1
  print(count+4)
Problem p02995 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
def gcd(x,y):
    while y!=0:
        x,y=y,x%y
    return x

NBC = B//C
NBD = B//D
CD_lcm = (C*D)//gcd(C,D)   #CとDの最小公倍数
NBCD = B//CD_lcm #CとD共通で割り切れる数
B_0 = (NBC+NBD)-NBCD  #Bの答え
ans_B = B-B_0
NAC = (A)//C
NAD = (A)//D
NACD = (A)//CD_lcm  
A_0 = (NAC+NAD)-NACD #Aの答え
ans_A = A-A_0
if A%C==0 or A%D==0:
    ans = ans_B-ans_A
else:
    ans = ans_B-ans_A+1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())
NBC = B//C
NBD = B//D
CD_lcm = (C*D)//math.gcd(C,D)   #CとDの最小公倍数
NBCD = B//CD_lcm #CとD共通で割り切れる数
B_0 = (NBC+NBD)-NBCD  #Bの答え
ans_B = B-B_0
NAC = (A)//C
NAD = (A)//D
NACD = (A)//CD_lcm  
A_0 = (NAC+NAD)-NACD #Aの答え
ans_A = A-A_0
if A%C==0 or A%D==0:
    ans = ans_B-ans_A
else:
    ans = ans_B-ans_A+1
print(ans)
Problem p03001 (python)

Fixed submission:
W, H, x, y = map(int, input().split())
if x == (W/2):
    if y == (H/2):
        men = W*H/2
        print(men)
        print(1)
    else:
        men = W*H/2
        print(men)
        print(0)
else:
        men = W*H/2
        print(men)
        print(0)

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
full = W*H
count = 0
if x == (W/2):
    if y == (H/2):
        men = W*H/2
        print(men)
        print(1)
    else:
        men = W*H/2
        print(men)
        print(0)
elif y==(H/2):
    men = W*H/2
    print(men)
    print(0)

else:
    X1 = x*H
    X2 = (W-x)*H
    X = [X1, X2]
    XX = max(X)
    Y1 = W*y
    Y2 = W*(H-y)
    Y = [Y1, Y2]
    YY = max(Y)
    if XX == YY:
        print(menseki)
        print(1)
    else:
        menseki = min(XX, YY)
        print(menseki)
        print(0)
Problem p03049 (python)

Fixed submission:
N = int(input())
count = 0
end = 0
start = 0
double = 0
for i in range(N):
    line = input()
    if "AB" in line:
        count += line.count("AB")
    if line[0] == "B":
        if line[-1] == "A":
            double +=1
        else:
            start += 1
    elif line[-1] == "A":
            end += 1
if double == 0:
    count += min(start, end)
elif start + end > 0:
    count += double + min(start, end)
elif start + end == 0:
    count += double - 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
end = 0
start = 0
double = 0
for i in range(N):
    line = input()
    if "AB" in line:
        count += 1
    if line[0] == "B":
        if line[-1] == "A":
            double +=1
        else:
            start += 1
    if line[-1] == "A":
        if line[0] == "B":
            double +=1
        else:
            end += 1
if double == 0:
    count += min(start, end)
elif start + end > 0:
    counr += double + min(start, end)
elif start + end == 0:
    count += double - 1
print(count)
Problem p03061 (python)

Fixed submission:
import fractions as math

n = int(input()) # 入力データの個数
a = list(map(int, input().split())) # 入力データ
 
l = [a[0] for _ in range(n+2)] # データの左端を初期値として追加
r = [a[-1] for _ in range(n+2)] # データの右端を初期値として追加
 
for i in range(n): # データのどこを置き換えるか
    l[i+1] = math.gcd(l[i], a[i]) # 置きかえる部分より左の最大公約数と置きかえる部分の最大公約数を更新する
    r[-(i+2)] = math.gcd(r[-(i+1)], a[-(i+1)]) # 置きかえる部分より右の最大公約数と置きかえる+1の最大公約数を更新する 
l[0] = r[0] = l[-1] = r[-1] = 0 # 初期値形に0を入れていく
 
ans = [math.gcd(l[i], r[i+2]) for i in range(n)] # 最大公約数のセットを改めて配列へ
print(max(ans)) # 最大公約数を出力

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
A = input().split()

max_gcd = 0
for i in range(N-1):
  for j in range(i+1, N):
    tmp = math.gcd(int(A[i]), int(A[j]))
    if max_gcd < tmp:
      max_gcd = tmp

print(max_gcd)
Problem p04001 (python)

Fixed submission:
s = input()
n = 0
ans = 0
for n in range( 1 << len(s) -1):
    p = 0
    for i in range(len(s) - 1):
        if n & (1 << i):
            ans += int(s[p:i + 1])
            p = i + 1
    if p < len(s):
        ans += int(s[p:])
print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin

a = stdin.readline().rstrip()
print(a.upper())
print(output)
Problem p03636 (python)

Fixed submission:
s   = input()

head, mid, tail = s[0], s[1:-1], s[-1]

print(head + str(len(mid)) + tail)

Buggy submission (verdict: Runtime Error):
print(head + str(len(mid)) + tail)
Problem p02898 (python)

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

count = 0
for ii in range(n):
    if h[ii] >= k:
        count += 1

print(count)

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

count =	0
for ii in range(n):
    if h[ii] >=	k:
	count += 1

print(count)
Problem p02909 (python)

Fixed submission:
S=str(input())

if S ==	"Sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
else:
    print("Sunny")

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

for ii in range(m):
    a[a.index(max(a))] = int(a[a.index(max(a))] / 2)

print(sum(a))
Problem p02993 (python)

Fixed submission:
s = list(str(input()))
ans = 0

for ii in range(len(s)-1):
    if s[ii] == s[ii+1]:
        ans = 1

if ans == 1:
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
import fractions

a,b,c,d = map(int,input().split())
lcm = c * d // fractions.gcd(c , d) 

if a % c == 0:
    c_start = int(a/c)
else:
    c_start = int(a/c)+1

if a % d == 0:
    d_start = int(a/d)
else:
    d_start = int(a/d)+1

if a % lcm == 0:
        lcm_start = int(a/lcm)
else:
        lcm_start = int(a/lcm)+1

c_end = int(b/c)
d_end = int(b/d)
lcm_end = int(b/lcm)

c_num = c_end - c_start + 1
d_num = d_end - d_start + 1
lcm_num=lcm_end - lcm_start + 1

print(b - a + 1 - c_num - d_num + lcm_num)
Problem p02995 (python)

Fixed submission:
import fractions

a,b,c,d = map(int,input().split())

def calc(n):
    return n-n//c-n//d+n//(c*d//fractions.gcd(c, d))

print(calc(b)-calc(a-1))

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())

def calc(n):
    return n-n//c-n//d+n//(c*d//math.gcd(c, d))


print(calc(b)-calc(a-1))

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())
lcm = c * d / math.gcd(c , d) 

if a % c == 0:
    c_start = int(a/c)
else:
    c_start = int(a/c)+1

if a % d == 0:
    d_start = int(a/d)
else:
    d_start = int(a/d)+1

if a % lcm == 0:
        lcm_start = int(a/lcm)
else:
        lcm_start = int(a/lcm)+1

c_end = int(b/c)
d_end = int(b/d)
lcm_end = int(b/lcm)

c_num = c_end - c_start + 1
d_num = d_end - d_start + 1
lcm_num=lcm_end - lcm_start + 1

print(b - a + 1 - c_num - d_num + lcm_num)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
count = 0

if a % c == 0:
    c_start = int(a/c)
else:
    c_start = int(a/c)+1

if a % d == 0:
    d_start = int(a/d)
else:
    d_start = int(a/d)+1

c_end = int(b/c)
d_end = int(b/d)

c_list=[0]*(c_end-c_start+1)
d_list=[0]*(d_end-d_start+1)

for ii in range(len(c_list)):
    jj = c_start + ii
    c_list[ii] = jj * c

for ii in range(len(d_list)):
    jj = d_start + ii
    d_list[ii] = jj * d

union = set(c_list) | set(d_list)

print(b - a + 1 - len(union))
Problem p03105 (python)

Fixed submission:
# -- coding: utf-8 --
a, b, c= map(int, input().split())

mon_lim = int(b/a)
if mon_lim < c:
    print(mon_lim)
else:
    print(c)

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

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

count = []

for ii in range(1, 101):
    if a % ii == 0 and b % ii == 0:
        count.append(ii)

print(count[-k])
Problem p02899 (python)

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
to=[]
for i in range(N):
  to.append([i,L[i]])
to=sorted(to, key=lambda x:x[1])
for i in range(N):
       print(to[i][0]+1,end=' ')

Buggy submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split())
to=[]
for i in range(N):
  to.append([i,L[i]])
to=sorted(to, key=lambda x:x[1])
for i in range(N):
       print(total[i][0],end='')
Problem p02923 (python)

Fixed submission:
n=int(input())
high=list(map(int,input().split()))
ans=[]
count=0
MaxC=0
for k in range(n-1):
    if high[k]>=high[k+1]:
        count+=1
        MaxC=max(MaxC,count)
    else:
        count=0
print(MaxC)

Buggy submission (verdict: Runtime Error):
n=int(input())
high=list(map(int,input().split()))
ans=[]
count=0
for k in range(n-1):
    high[k]>=high[k+1]:
            count+=1
        else:
            ans.append(count)
            count=0
print(max(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
high=list(map(int,input().split()))
ans=[]
count=0
for k in range(n):
    high[k]>=high[k+1]:
            count+=1
        else:
            ans.append(count)
            count=0
print(max(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
high=list(map(int,input().split()))
ans=[]
count=0
answer=[]
for i in range(n-1):
    ans.append(high[i]-high[i+1])
k=0
while k<=n-2:
    if ans[k]>=0:
        count+=1
        k+=1
    else:
        answer.append(count)
        count=0
        k+=1
        
print(max(answer))

Buggy submission (verdict: Runtime Error):
n=int(input())
high=list(map(int,input().split()))
ans=[]
count=0
answer=[]
for i in range(n-1):
    ans.append(high[i]-high[i+1])
k=0
while k<=n-1:
    if ans[k]>=0:
        count+=1
        k+=1
    else:
        answer.append(count)
        count=0
        k+=1
        
print(max(answer))

Buggy submission (verdict: Runtime Error):
n=int(input())
high=list(map(int,input().split()))
ans=[]
i=0
while i<=n-1:
    count=0
    k=i
    while k<=n-1:
        if high[k]>=high[k+1]:
            count+=1
        else:
            break
        k+=1
    ans.append(count)
    i+=count
print(max(ans))
Problem p02952 (python)

Fixed submission:
n=int(input())
if n==100000:
  print(90909)
elif 10000<=n<=99999:
  print((n-10000)+910)
elif 1000<=n<=9999:
  print(909)
elif 100<=n<=999:
  print((n-100)+10)
elif 10<=n<=99:
  print(9)
elif 1<=n<=9:
  print(n)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n==100000:
  print(90909)
elif 10000<=n<=99999:
  print((n-10000)+910)
elif 1000<=n<=9999:
  print(909)
elif 100<=n<=999:
  print(n-100)+10
elif 10<=n<=99:
  print(9)
elif 1<=n<=9:
  print(n)
Problem p02999 (python)

Fixed submission:
x,a=map(int,input().split())
if x<a:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
x,a=int(input())
if x<a:
  print(0)
else:
  print(10)
Problem p03000 (python)

Fixed submission:
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=1
high=0
for i in range(n):
    high+=L[i]
    if high<=x:
        count+=1


print(count)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=0
high=0
for i in range(n+1):
  if high>x:
    break
  else:
    count+=1
    if i<n+1:
        high+=L[i]

print(count)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=0
high=0
for i in range(n+1):
  if high>x:
    break
  else:
    count+=1
    high+=L[i]
print(count)
Problem p03067 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
if a < c < b or b < c < a:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
ab = int(b / a)
if a < c < b or b < c < a:
    print('Yes')
else:
    print('No')
Problem p03101 (python)

Fixed submission:
# -*- coding: utf-8 -*-
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w)
Problem p03110 (python)

Fixed submission:
# -*- coding: utf-8 -*-
btc = 380000.0
y = 0.0
for i in range(int(input())):
    x, u = input().split()
    x = float(x)
    if u == "BTC":
         y += x * btc
    else:
        y += x

print(y)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
btc = 380000.0
y=0
for i in range(int(input())):
    x, u = input().split()
    x = int(x)
    if u = "BTC":
         y = y + x * btc
    else:
        y = x
print(y)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
btc = 380000.0
y=0
for i in range(int(input())):
    x, u = input().split()
    if u = "BTC":
         y = y + x * btc
    else:
        y = x
print(y)
Problem p03125 (python)

Fixed submission:
a,b = input().split(" ")
print(int(a)+int(b)) if int(b)%int(a)==0 else print(int(b)-int(a))

Buggy submission (verdict: Runtime Error):
a,b = input().split(" ")
if int(b)%int(a)==0:
  print(int(a)+int(b)
else:
  print(int(b)-int(a))
Problem p02898 (python)

Fixed submission:
n,k = [int(x) for x in input().split()]
cnt=0
list  = input().split()
for num in list:
    if int(num)>=k: cnt=cnt+1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
k =int(input()) 
count=0
for i in range(n):
  x=int(input())
  if x>=k:
    count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
n,k = [int(x) for x in input().split()] 
count=0
for i in range(n):
  x=int(input())
  if x>=k:
    count=count+1
print(count)
Problem p03455 (python)

Fixed submission:
#https://atcoder.jp/contests/abc086/tasks/abc086_a
#
a,b = map(int,input().split())
if ((a*b)% 2) == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):

#入力受け取り
n = int(input())
tourList = []
for i in range(n):
    array = list(map(int, input().strip().split()))
    tourList.append(array)

#DebugPrint
currentTime = 0
currentX = 0
currentY = 0

for i in range(len(tourList)) :
    Time = tourList[i][0]
    X = tourList[i][1]
    Y = tourList[i][2]

    Time = Time - currentTime
    X = X - currentX
    Y = Y - currentY
    flag=False
    Z=0 #往復調整用

    if( (Time-abs(X+Y))%2==0 ):
        flag=True

    # while (X+Y+Z) <= Time :
    #     if X+Y+Z == Time:
    #         flag=True
    #         break
    #     else:
    #         Z+=2
    
    #継続判定
    if flag == False:
        print("No")
        exit()
    
    currentTime = Time
    currentX = X
    currentY = Y

print("Yes")

    #最初の点がまず実現可能か
Problem p03470 (python)

Fixed submission:
n = int(input())
loop = 0
array = []
moti = []

while loop < n :
    array.append(int(input()))
    loop += 1

for i in range(len(array)):
    if moti.count( array[i] )==0:
        moti.append(array[i])

print(len(moti))

Buggy submission (verdict: Runtime Error):
n = int(input())
loop = 0
array = []
moti = []

while loop < n :
    array.append(int(input()))
    loop += 1

for i in array:
    if moti.count( array[i] )==0:
        moti.append(array[i])

print(len(moti))
Problem p03493 (python)

Fixed submission:
num = input()
print(num.count("1"))

Buggy submission (verdict: Runtime Error):
loop = int(input())
kokuban=[int(x) for x in input().split()]
print(kokuban)

flag=False
result =0

while(flag==False) :
    for index,obj in enumerate(kokuban) :
        print(int(obj))
        if int(obj)%2 == 0:
            kokuban[index]= int(obj)//2
        else:
            flag=True
    if flag==False :
        result +=1

print(result)