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

Fixed submission:
x = int(input())
p = x // 11
q = x % 11
if q == 0 :
    ans = 2 * p
elif q <= 6 :
    ans = 2 * p + 1
else :
    ans = 2 * p + 2
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
p = x // 11
q = x % 11
if q = 0 :
    ans = 2 * p
elif q <= 6 :
    ans = 2 * p + 1
else :
    ans = 2 * p + 2
print(ans)
Problem p04029 (python)

Fixed submission:
n = int(input())
ans = int(n * (n + 1) /2)
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
ans = int(n * (n + 1) / 2)
print(ans)
Problem p04043 (python)

Fixed submission:
a,b,c = input().split()
 
a = int(a)
b = int(b)
c = int(c)
 
 
if(a + b + c) != 17:
  print("NO")
elif(a + b + c) == 17:
    if(a + b == 10) | (b + c == 10) | (c + a == 10):
      print("YES")
    else:
      print("NO")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
i = input().split()
s, t = map(int, i)
str_list = []

for i in range(s):
    string = input()
    str_list.append(string)

str_list.sort()
ans = ''.join(str_list)

print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
 
a = int(a)
b = int(b)
c = int(c)
 
 
if(a + b + c) != 17:
  print("NO")
elif(a + b + c) = 17:
    if(a + b == 10) | (b + c == 10) | (c + a == 10):
      print("YES")
    else:
      print("NO")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
 
a = int(a)
b = int(b)
c = int(c)
 
 
if(a + b + c) != 17:
  print("NO")
elif(a + b + c) == 17:
    if(a + b == 10) || (b + c == 10) || (c + a == 10):
      print("YES")
    else:
      print("NO")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()

a = int(a)
b = int(b)
c = int(c)


if(a + b + c) != 17:
  print("NO")
elif(a + b + c) = 17:
    if(a + b == 10) || (b + c == 10) || (c + a == 10):
      print("YES")
    else:
      print("NO")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()

if(a + b + c) != 17:
  print("NO")
elif(a + b + c) = 17:
    if(a + b == 10) || (b + c == 10) || (c + a == 10):
      print("YES")
    else:
      print("NO")
else:
  print("NO")
Problem p04044 (python)

Fixed submission:
i = input().split()
s, t = map(int, i)
str_list = []

for i in range(s):
    string = input()
    str_list.append(string)

str_list.sort()
ans = ''.join(str_list)

print(ans)

Buggy submission (verdict: Runtime Error):
i = input().split()
s, t = map(int, i)
str_list = []

for i in range(3):
    string = input()
    str_list.append(string)

str_list.sort()
ans = ''.join(str_list)

print(ans)
Problem p03109 (python)

Fixed submission:
S = input()
if S <= '2019/04/30':
    print('Heisei')
else:
    print('TBD')

Buggy submission (verdict: Runtime Error):
print "Hello"
Problem p03109 (python)

Fixed submission:
date =list(map(int,input().split('/')))
print('TBD' if date[1]*31+date[2]>=155 else 'Heisei')

Buggy submission (verdict: Runtime Error):
date = map(int,input().split('/'))
print('TBD' if data[0]>=2019 and data[1]*30+data[2]>=150 else 'Heisei')
Problem p03109 (python)

Fixed submission:
import sys

for S in sys.stdin:
  y,m,d = [int(x) for x in S.split('/')]
  if y<=2019 and m<=4:
    print('Heisei')
  else:
    print('TBD')

Buggy submission (verdict: Runtime Error):
import bisect
inf = 10**18
A,B,Q = map(int,input().split(' '))
ss = [-inf] + sorted([int(input()) for i in range(1,A+1)]) + [inf]
ts = [-inf] + sorted([int(input()) for i in range(A+1,A+B+1)]) + [inf]

def f0(A,x):
  i = bisect.bisect_left(A, x)
  return i, i-1
def f1(A,B,x):
  a = f0(A,x)
  bs = [f0(B,A[i]) for i in a]
  return min([abs(A[i]-x) + abs(A[i]-B[j]) 
              for ix, i in enumerate(a) 
              for j in bs[ix]]) 

for i in range(A+B+1,A+B+Q+1):
  x = int(input())
  print(min(f1(ss,ts,x),f1(ts,ss,x)))

Buggy submission (verdict: Runtime Error):
import sys

for S in sys.stdin
  if S <= '20190430':
    print('Heisei')
  else:
    print('TBD')

Buggy submission (verdict: Runtime Error):
import sys

S = sys.argv
if S <= '20190430':
  print('Heisei')
else:
  print('TBD')
Problem p03110 (python)

Fixed submission:
import sys

z = 0
for line in sys.stdin:
  xs = line.split()
  if len(xs) < 2:
    continue
  if xs[1] == 'BTC':
    z += 380000 * float(xs[0])
  else: 
    z += float(xs[0])
print(z)

Buggy submission (verdict: Runtime Error):
import sys

z = 0
for line in sys.stdin:
  xs = map(int, line.split())
  if len(xs) < 2:
    continue
  if xs[1] == 'BTC':
    z += 380000 * xs[0]
  else: 
    z += xs[0]
print(z)

Buggy submission (verdict: Runtime Error):
import sys

z = 0
for line in sys.stdin:
  xs = [float(x) for x in line.split()]
  if len(xs) == 1: 
    continue
  z += 380000 * xs[0] if xs[1] == 'BTC' else xs[0]
print(z)

Buggy submission (verdict: Runtime Error):
import sys

z = 0
for line in sys.stdin:
  xs = map(int, line.split())
  if len(xs) == 1: continue
  z += 380000 * xs[0] if xs[1] == 'BTC' else xs[0]
print(z)
Problem p03125 (python)

Fixed submission:
A, B = map(int, input().split())
print(A+B if B % A == 0 else B-A)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
return A+B if B % A == 0 else B-A

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
return A+B if B % A == 0 else B-a
Problem p03219 (python)

Fixed submission:
a,b = map(int,input().split())
print(a+b//2)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
print(a+b//2)
Problem p03110 (python)

Fixed submission:
N = int(input())
rateBtcYen =  380000.0 
totalYen = 0
for i in range(0, N):
    amountString, currency = input().split()
    amount = float(amountString)
    if currency == "BTC":
        totalYen += amount*rateBtcYen
    else:
        totalYen += amount
print(totalYen)

Buggy submission (verdict: Runtime Error):
# Input part 
N = int(input())
rateBtcYen =  380000.0 
totalYen = 0
for i in range(0, N):
    amountString, currency = input().split()
    amount = int(amountString)
    if currency == "BTC":
        totalYen += amount*rateBtcYen
    else:
        totalYen += amount
print(totalYen)
Problem p03109 (python)

Fixed submission:
yy,mm,dd =map(int,input().split('/'))
x = 0
if(yy<=2019):
  if(mm<=4):
    if(dd<=30):
      x = 1
         
if(x == 1):
  print('Heisei')
else:
  print('TBD')

Buggy submission (verdict: Runtime Error):
    yy,mm,dd =map(int,input().split('/'))
    x = 0
    if(yy<=2019):
      if(mm<=4):
        if(dd<=30):
         x = 1
     
    if(x == 1):
      print('Heisei')
    else:
      print('TBD')

Buggy submission (verdict: Runtime Error):
    yy,dd,mm =map(int,input().split('/'))
    x = 0
    if(yy<=2019):
      if(mm<=4):
        if(dd<=30):
         x = 1
     
    if(x == 1):
      print('Heisei')
    else:
      print('TBD')

Buggy submission (verdict: Runtime Error):
yy,dd,mm = int(input().split('/'))
x = 0
if(yy<=2019):
  if(mm<=4):
    if(dd<=30):
     x = 1

if(x == 1):
  print('Heisei')
else:
  print('TBD')
Problem p03126 (python)

Fixed submission:
N, M = map(int, input().split())
vectors = [list(map(int, input().split())) for i in range(N)]

sumamry = [0] * 30
for vec in vectors:
    ans = vec[1:]
    for a in ans:
        sumamry[a-1] += 1

ret = 0
for s in sumamry:
    if s == N:
        ret += 1

print(ret)

Buggy submission (verdict: Runtime Error):
N = int(input())
vectors = [input().split() for i in range(N)]

value = 0
converter = {
    'JPY' : 1,
    'BTC' : 380000
}
for v in vectors:
    x, u = v
    value += float(x) * converter.get(u)

print(value)
Problem p03129 (python)

Fixed submission:
N, K = [int(s) for s in input().split(' ')]
x = 0
if N%2:
    x = (N + 1) / 2
else:
    x = N/ 2
if x>=K:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
def solution(edges):
    num_of_neighbor = {}
    for e in edges:
        if e[0] in num_of_neighbor:
            num_of_neighbor[e[0]] += 1
        else:
            num_of_neighbor[e[0]] = 1
        if e[1] in num_of_neighbor:
            num_of_neighbor[e[1]] += 1
        else:
            num_of_neighbor[e[1]] = 1
    n_2 = 0
    n_1 = 0
    for n in num_of_neighbor:
        if num_of_neighbor[n] == 2:
            n_2 += 1
        elif num_of_neighbor[n] == 1:
            n_1 += 1

        if n_2 == 2 and n_1 == 2:
            return 'YES'
        else:
            return 'NO'

e1 = [int(s) for s in input().split(' ')]
e2 = [int(s) for s in input().split(' ')]
e3 = [int(s) for s in input().split(' ')]
edges = [e1, e2, e3]
print(solution(edges))

Buggy submission (verdict: Runtime Error):
def solution(N, K):
	x = 0
	if N%2:
      x = N/2
	else:
      x = (N-1) / 2
    return K<=x
N, K = [int(s) for s in input().split(' ')]
print(solution(N, K))

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
x = 0
if N%2:
  x = N/2
else:
  x = (N-1) / 2
return K<=x

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
  x = 0
  if N%2:
    x = N/2
  else:
    x = (N-1) / 2
   
  return K<=x

Buggy submission (verdict: Runtime Error):
int main():
  x = 0
  if N%2:
    x = N/2
  else:
    x = (N-1) / 2
   
  return K<=x
Problem p03130 (python)

Fixed submission:
def solution(edges):
    num_of_neighbor = {}
    for e in edges:
        if e[0] in num_of_neighbor:
            num_of_neighbor[e[0]] += 1
        else:
            num_of_neighbor[e[0]] = 1
        if e[1] in num_of_neighbor:
            num_of_neighbor[e[1]] += 1
        else:
            num_of_neighbor[e[1]] = 1
    n_2 = 0
    n_1 = 0
    for n in num_of_neighbor:
        if num_of_neighbor[n] == 2:
            n_2 += 1
        elif num_of_neighbor[n] == 1:
            n_1 += 1

    if n_2 == 2 and n_1 == 2:
        return 'YES'
    else:
        return 'NO'

e1 = [int(s) for s in input().split(' ')]
e2 = [int(s) for s in input().split(' ')]
e3 = [int(s) for s in input().split(' ')]
edges = [e1, e2, e3]
print(solution(edges))

Buggy submission (verdict: Runtime Error):
def solution(edges):
    num_of_neighbor = {}
    for e in edges:
        if e[0] in num_of_neighbor:
            num_of_neighbor[e[0]] += 1
        else:
            num_of_neighbor[e[0]] = 1
        if e[1] in num_of_neighbor:
            num_of_neighbor[e[1]] += 1
        else:
            num_of_neighbor[e[1]] = 1
    n_2 = 0
    n_1 = 0
    for n in num_of_neighbor:
        if num_of_neighbor[n] == 2:
            n_2 += 1
        elif num_of_neighbor[n] == 1:
            n_1 += 1

        if n_2 == 2 and n_1 == 2:
            return 'YES'
        else:
            return 'NO'




e1 = [int(s) for s in input().split(' ')]
e2 = [int(s) for s in input().split(' ')]
e3 = [int(s) for s in input().split(' ')]
edges = [e1, e2, e3]
print(solution(table))
Problem p03126 (python)

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

result = [0]*M

for i in range(N):
  foods = map(int, raw_input().split())
  pers_count = foods.pop(0)
  
  for f in foods:
    result[f-1] += 1

res_count = 0
for r in result:
  if N == r:
    res_count += 1

print res_count

Buggy submission (verdict: Runtime Error):
# N = number of people
# M = number of foods

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

result = [0]*M

for i in range(N):
  foods = map(int,raw_input().split())
  pers_count = foods.pop(0)
  
  for f in foods:
    results[f-1] += 1

res_count = 0
for r in results:
  if M == r:
    res_count += 1
print res_count
Problem p03719 (python)

Fixed submission:
a,b,c = (int(i) for i in input().split())
if(a<=c and c<=b):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = for i in input().split()

if(a <= c && c <= b)
    print('Yes')
else
    print('No')
Problem p03109 (python)

Fixed submission:
import os
import sys
import datetime

def main():
    sDate = datetime.datetime.strptime("2019/04/30", '%Y/%m/%d')

    inputdate = input()

    try:
        inputdate = datetime.datetime.strptime(inputdate, '%Y/%m/%d')
    except:
        print("Error: illegal date format.")
        return 1

    if inputdate <= sDate:
        print("Heisei")
    else:
        print("TBD")

    return 0

if __name__ == '__main__':
    sys.exit(main())

Buggy submission (verdict: Runtime Error):
import os
import sys
import datetime

def main():
    sDate = datetime.datetime.strptime("2019/04/30", '%Y/%m/%d')
    args = sys.argv
    argdate = ""

    if len(args) == 1:
        print("Error: invalid arguments.")
        return 2

    datestr = args[1]

    try:
        argdate = datetime.datetime.strptime(datestr, '%Y/%m/%d')
    except:
        print("Error: illegal date format.")
        return 1

    if argdate <= sDate:
        print("Heisei")
    else:
        print("TBD")

    return 0

if __name__ == '__main__':
    sys.exit(main())
Problem p03109 (python)

Fixed submission:
S = input()

if S <= "2019/04/30":
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):

nen,mon,day = map(int,input().split('/'))

if nen >= 2019:
  if mon >= 5:  
    print("Heisei")
  else if day >= 30 and mon ==4:
    print("Heisei")
else:
    print("TBD")
Problem p03109 (python)

Fixed submission:
from datetime import datetime

if __name__ == '__main__':
  S = raw_input()
  Sdate = datetime.strptime(S, '%Y/%m/%d')
  if Sdate <= datetime(2019, 4, 30):
    print('Heisei')
  else:
    print('TBD')

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
  S = raw_input()
  Sdate = datetime.date(S.year, S.month)
  if Sdate <= datetime(2019, 4, 30):
    print('Heisei')
  else:
    print('TBD')

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
  S = raw_input
  Sdate = datetime.date(S.year, S.month)
  if Sdate <= datetime(2019, 4, 30):
    return Heisei
  else:
    return TBD
Problem p03260 (python)

Fixed submission:
a, b = map(int, input().split())
if a % 2 == 0 or b % 2 == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import numpy

a, b = map(int, input().split())
c = np.asarray([[1,2,3], [4,5,6]])
if a % 2 == 0 or b % 2 == 0:
    print("No")
else:
    print("Yes")
Problem p03263 (python)

Fixed submission:
h, w = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(h)]

ans = []
ope = []
def operate(i, j, k, l):
    a[i][j] -= 1
    a[k][l] += 1
    ans.append([i+1, j+1, k+1, l+1])

for j in range(0, w):
    for i in range(0, h-1):
        if a[i][j]%2 == 1:
            operate(i, j, i+1, j)
for j in range(0, w-1):
    if a[h-1][j]%2 == 1:
        operate(h-1, j, h-1, j+1)

print(len(ans))
for i in range(0, len(ans)):
    print(ans[i][0],ans[i][1],ans[i][2],ans[i][3],end="")
    print()

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = []
for i in range(H):
    a.append(list(map(int, input().split())))

ans = []
def operate(i, j, k, l):
    a[i][j] -= 1
    a[k][l] += 1
    ans.append([i+1, j+1, k+1, l+1])

for j in range(0, w):
    for i in range(0, h-1):
        if a[i][j]%2 == 1:
            operate(i, j, i+1, j)
for j in range(0, w-1):
    if a[h-1][j]%2 == 1:
       operate(h-1, j, h-1, j+1)

print(len(ans))
for i in ans:
    print("{} {} {} {}".format(i[0], i[1], i[2], i[3]))

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(h)]
ans = []
for j in range(0, w):
    for i in range(0, h-1):
        if a[i][j]%2 == 1:
            a[i][j] -= 1
            a[i+1][j] += 1
            ans.append([i+1, j+1, k+1, l+1])
for j in range(0, w-1):
    if a[h-1][j]%2 == 1:
        a[h-1][j] -= 1
        a[h-1][j+1] += 1
        ans.append([h-1, j, h-1, j+1])
print(len(ans))
for i in range(0, len(ans)):
    print(ans[i][0],ans[i][1],ans[i][2],ans[i][3],end="")
    print()
Problem p03635 (python)

Fixed submission:
n, m = map(int, input().split())
print((n - 1) * (m - 1))

Buggy submission (verdict: Runtime Error):
print((int(input()) - 1) * (int(input()) - 1))
Problem p03126 (python)

Fixed submission:
import sys
num = sys.stdin.readline().split()
d = {}
for line in sys.stdin.readlines():
  n = line.split()
  n.pop(0)
  for s in n:
    if s in d :
      d[s] = d[s]+1
    else :
      d[s] = 1
keys = [k for k, v in d.items() if v == int(num[0])]
print(len(keys))

Buggy submission (verdict: Runtime Error):
import sys
num = [int(s) for s in sys.stdin.readline().split()]
d = {}
for line in sys.stdin.readlines():
  n = [int(s) for s in line.split()]
  print n
  for s in range(1,n[0]+1):
    if s in d :
      d[n[s]] = d[n[s]]+1
    else :
      d[n[s]] = 1
keys = [k for k, v in d.items() if v == num[0]]
print(len(keys))
Problem p03109 (python)

Fixed submission:
Y,M,D=map(int,input().split("/"))
if (Y,M,D)>(2019,4,30):
  print("TBD")
else:
   print("Heisei")

Buggy submission (verdict: Runtime Error):
from datetime.datetime import datetime
S=datetime.strptime(S,'%Y/%m/%d')
x=datetime.datetime(2019, 4, 30, 0, 0)
if x>S:
     print('TBD')
else:
     print("Heisei")

Buggy submission (verdict: Runtime Error):
from datetime.datetime import datetime
datetime.datetime(2019, 4, 30, 0, 0)
S=datetime.strptime(S,'%Y/%m/%d')
x=datetime.datetime(2019, 4, 30, 0, 0)
if x>S:
     print('TBD')
else:
     print("Heisei")
Problem p03109 (python)

Fixed submission:
S = input()

if S <= "2019/04/30":
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):
S = input()
if S =< 2019/04/30:
  print("Heisei")
else:
  print("TBD")

Buggy submission (verdict: Runtime Error):
if S >= 2019/04/30:
  print("Heisei")
  
else:
  print("TBD")
Problem p03721 (python)

Fixed submission:
n,k = map(int,raw_input().split())
l = []
s = list()
for i in range(n):
    v,count = map(int,raw_input().split())
    l.append((count,v))

l = sorted(l, key=lambda x: x[1])

countTmp = 0
for count,v in l:
    countTmp = countTmp + count
    if k <= countTmp:
       print v
       break

Buggy submission (verdict: Runtime Error):
n,k = map(int,raw_input().split())
l = []
s = list()
for i in range(n):
    v,count = map(int,raw_input().split())
    l.append((count,v))

sorted(l, key=lambda x: x[1])

countTmp = 0
for count,v in l:
    count >= k:
        print v
        break
    countTmp = countTmp + count
    if k <= countTmp:
       print v
       break;
Problem p03962 (python)

Fixed submission:
l =  map(int,raw_input().split())
print len(set(l))

Buggy submission (verdict: Runtime Error):
def solve(t,a,tp,ap):

    if t/a == tp/ap:
        return t,a
    
    next_t=0
    next_a=0
    
    num_a = max( int(a/ap)  , int(t/tp) )
    next_t = num_a*tp
    next_a = num_a*ap

    while not(next_t > t and next_a > a):
        next_t += tp
        next_a += ap
    return next_t,next_a


N = int(raw_input())
l = []
for i in range(N):
    l.append( map(float,raw_input().split()) )

t = 1.0
a = 1.0

while len(l):
    tp,ap = l.pop(0)
    t,a = solve(t,a,tp,ap)

print int(t+a)
Problem p03109 (python)

Fixed submission:
import datetime
date = list(map(int,input().split("/")))
date2 = datetime.datetime(date[0],date[1],date[2])
date3 = datetime.datetime(2019,4,30)
if date2 > date3:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
N = int(input())
SUM = 0
for i in range(N):
    ODM = input().split()
    if ODM[1] == "JPY":
        SUM = SUM + float(ODM[0])
    else:
        SUM = SUM + float(ODM[0])*380000
print(SUM)
Problem p03109 (python)

Fixed submission:
from sys import stdin


year, month, date = stdin.readline().rstrip().split(sep='/')

y = int(year)
m = int(month)
d = int(date)

heisei_y = 2019
heisei_m = 4
heisei_d = 30

if y < heisei_y:
  print('Heisei')
elif  (y == heisei_y) and (m < heisei_m):
  print('Heisei')
elif  ((y == heisei_y) and m == heisei_m) and (d <= heisei_d):
  print('Heisei')
else:
  print('TBD')

Buggy submission (verdict: Runtime Error):
import stdin

year, month, date = stdin.readline().rstrip().split('/')

y = int(year)
m = int(month)
d = int(date)

heisei_y = 2019
heisei_m = 4
heisei_d = 1

if y < heisei_y:
  print('Heisei')
elif  m < heisei_m:
  print('Heisei')
elif  d < heisei_d:
  print('Heisei')
else:
  print('TBD')

Buggy submission (verdict: Runtime Error):
import stdin

year, month, date = stdin.readline().rstrip().split(sep='/')

y = int(year)
m = int(month)
d = int(date)

heisei_y = 2019
heisei_m = 4
heisei_d = 1

if y < heisei_y:
  print('Heisei');
elif  m < heisei_m:
  print('Heisei');
elif  d < heisei_d:
  print('Heisei');
else:
  print('TBD');

Buggy submission (verdict: Runtime Error):
import stdin

year, month, date = stdin.readline().rstrip().split(sep='/')

y = int(year)
m = int(month)
d = int(date)

heisei_y = 2019
heisei_m = 4
heisei_d = 1

if (y < heisei_y):
  print('Heisei');
  else if ( m < heisei_m):
    print('Heisei');
    else if ( d < heisei_d):
      print('Heisei');
      else:
        print('TBD');
Problem p03110 (python)

Fixed submission:
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
    x[i],u[i] = map(str, input().split())
    x[i] = float(x[i])

sum = 0

for i in range(N):
    if (u[i] == 'JPY'):
        sum += x[i]
    elif (u[i] == 'BTC'):
        sum += x[i] * 380000
    else:
        break
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
    u[i],x[i] = map(str, input().split())
    x[i] = float(x[i])

sum = 0

for i in range(N):
    if (u[i] == 'JPY'):
        sum += x[i]
    elif (u[i] == 'BTC'):
        sum += x[i] * 380000
    else:
        break
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
x = [0] * N
u = [0] * N
for i in range(N):
    x[i],u[i] = map(int, input().split())
sum = 0
for i in range(N):
    if (u[i] == 'JPY'):
        sum += x[i]
    elif (u[i] == 'BTC'):
        sum += x[i] * 380000
    else:
        break
Problem p03109 (python)

Fixed submission:
def solver():
	a = input().rstrip('\n').split('/')
	if int(a[0]) > 2019:
		print('TBD')
	elif int(a[0]) < 2019:
		print('Heisei')
	else:
		if int(a[1]) > 4:
			print('TBD')
		elif int(a[1]) < 4:
			print('Heisei')
		else:
			if int(a[2]) > 30:
				print('TBD')
			elif int(a[2]) < 30:
				print('Heisei')
			else:
				print('Heisei')

solver()

Buggy submission (verdict: Runtime Error):
def solver():
  a = input().rstrip('\n').split('/')
  if int(a[0]) >= 2019:
  	if int(a[1]) >= 4:
  		if int(a[2]) >= 30:
          print('TBD')
  else:
    print('Heisei')
    
solver()
Problem p03110 (python)

Fixed submission:
sum41 = 0
n = int(input())
for _ in range(n):
	tmp = input().split(' ')
	sum41 += float(tmp[0]) if tmp[1] == 'JPY' else float(tmp[0]) * 380000

print(1.0 * sum41)

Buggy submission (verdict: Runtime Error):
def calc(val, unit):
	if unit == 'BTC':
		val *= 380000
	return val

sum41 = 0
n = int(input())
for _ in range(n):
	tmp = input().rstrip('\n').split(' ')
	sum41 += calc(int(tmp[0]), tmp[1])

print(1.0 * sum41)

Buggy submission (verdict: Runtime Error):
def calc(val, unit):
	if unit == 'BTC':
		val *= 380000
	return val

sum41 = 0
n = int(input())
for i in range(n):
	tmp = input().rstrip('\n').split(' ')
	sum41 += calc(tmp[0], tmp[1])

print(1.0 * sum41)
Problem p03109 (python)

Fixed submission:
import sys

lines = sys.stdin.readlines()
S = lines[0]

Ss = S.split('/')

if int(Ss[0]) >= 2019:
  if int(Ss[1]) >= 5:
    print('TBD')
    exit(0)
print('Heisei')

Buggy submission (verdict: Runtime Error):
import sys
import datetime

lines = sys.stdin.readlines()
X = lines[0]

d = datetime.datetime.strptime(X, '%Y/%m/%d')

if d > datetime.datetime(2019,4,30):
  print('TBD')
else:
  print('Heisei')

Buggy submission (verdict: Runtime Error):
import sys
import datetime

lines = sys.stdin.readlines()
X = lines[0]

d = datetime.datetime.strptime(X, '%Y/%m/%d')

if d > datetime.datetime(2019,4,30):
  print('TBD')
else:
  print('Heisei')
Problem p03155 (python)

Fixed submission:
import sys

lines = sys.stdin.readlines()

N = int(lines[0])
H = int(lines[1])
W = int(lines[2])

p_row = N - H + 1
p_column = N - W + 1

ans = p_row * p_column
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

lines = sys.stdin.readlines()

N = lines[0]
H = lines[1]
W = lines[2]

p_row = H - N + 1
p_column = W - N + 1

ans = p_row * p_column
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

lines = sys.stdin.readlines()

N = lines[0]
H = lines[1]
W = lines[2]

p_row = H - N + 1
p_column = W - N + 1

ans = p_row * p_column
print(ans)