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

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 15 21:08:34 2018

@author: ogura
"""

n = int(input())

if n == 1:
    print('Hello World')
elif n == 2:
    a = int(input())
    b = int(input())
    print(a + b)
else:
    ''

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Oct  6 21:37:39 2018

@author: ogura
"""
import math

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

for i in range(10000):
    a = math.gcd(m, i)
    if a == 1:
        continue
    tmp = int(a *(1 - a ** n) // (1 - a))
    if tmp == m:
        break

print(a)
Problem p03260 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, input().split())

if ((a * b) % 2) == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from fractions import gcd

# スペース区切りの整数の入力
N, X = map(int, input().split())
pos = [int(x.strip()) for x in input().split()]

# 一番近い場所を検索
tikai = [i - X for i in pos]
kyori = list(map(abs,tikai))

a = kyori[0]
for xi in kyori[1:]:
    a = gcd(a, xi)
print(a)
Problem p03262 (python)

Fixed submission:
# -*- coding: utf-8 -*-
from fractions import gcd

# スペース区切りの整数の入力
N, X = map(int, input().split())
pos = [int(x.strip()) for x in input().split()]

# 一番近い場所を検索
tikai = [i - X for i in pos]
kyori = list(map(abs,tikai))

a = kyori[0]
for xi in kyori[1:]:
    a = gcd(a, xi)
print(a)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import functools
import math

# スペース区切りの整数の入力
N, X = map(int, input().split())
pos = [int(x.strip()) for x in input().split()]

# 一番近い場所を検索
tikai = [i - X for i in pos]
kyori = list(map(abs,tikai))

gcd = functools.reduce(math.gcd, kyori)

print(gcd)
Problem p03293 (python)

Fixed submission:
# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print("No")

for i in range(slen):
    if s == t:
        print("Yes")
        break
    s = s[-1] + s[:-1]

if s != t:
    print("No")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print('No')
    break

for i in range(slen):
    if s == t:
        print("Yes")
        break
    s = s[-1] + s[:-1]
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
import math
N, M = map(int,input().split())
j=1
for i in range(1, int(math.sqrt(M))+2):
    if M%i==0:
        if i <= M//N and j < i:
            j=i
        if M/i <= M//N and j < M/i:
            j=M/i
print(j)
Problem p03263 (python)

Fixed submission:
H, W = map(int,input().split())
a=[]
N2=0
for i in range(H):
    b=[int(i) for i in input().split()]
    for j in range(W):
        if b[j]%2==1:
            N2+=1
    a.append(b)
if N2%2==1:
    N2-=1
N=0
N3=0
idou=1
if W==1:
    idou=2
c=0
i=0
j=0
s=[]
for k in range(H*W):
    if N3==N2:
        break
    if idou==1:
        if a[i][j]%2==1:
            N+=1
            s.append(str(i+1)+" "+str(j+1)+" "+str(i+1)+" "+str(j+2))
            a[i][j+1]+=1
            a[i][j]-=1
            if a[i][j+1]%2==0:
                N3+=2
        j+=1
        if j==W-1-c:
            idou=2
    elif idou==2:
        if a[i][j]%2==1:
            N+=1
            s.append(str(i+1)+" "+str(j+1)+" "+str(i+2)+" "+str(j+1))
            a[i+1][j]+=1
            a[i][j]-=1
            if a[i+1][j]%2==0:
                N3+=2
        i+=1
        if i==H-1-c:
            idou=3
    elif idou==3:
        if a[i][j]%2==1:
            N+=1
            s.append(str(i+1)+" "+str(j+1)+" "+str(i+1)+" "+str(j))
            a[i][j-1]+=1
            a[i][j]-=1
            if a[i][j-1]%2==0:
                N3+=2
        j-=1
        if j==c:
            idou=4
    elif idou==4:
        if a[i][j]%2==1:
            N+=1
            s.append(str(i+1)+" "+str(j+1)+" "+str(i)+" "+str(j+1))
            a[i-1][j]+=1
            a[i][j]-=1
            if a[i-1][j]%2==0:
                N3+=2
        i-=1
        if i==c+1:
            idou=1
            c+=1
print(N)
for i in range(N):
    print(s[i])

Buggy submission (verdict: Runtime Error):
def gcd(x,y):
    if x>=y:
        if x%y==0:
            return y
        else:
            return gcd(y,x%y)
    else:
        if y%x==0:
            return x
        else:
            return gcd(x,y%x)
def gcd2(x4):
    if len(x4)>2:
        return gcd2([gcd(x4[0],x4[1]),]+x4[2:])
    elif len(x4) ==2:
        return gcd(x4[0],x4[1])
    else:
        return x4[0]
N, X = map(int,input().split())
x=[int(i) for i in input().split()]
x.append(X)
x3=[]
for i in range(len(x)-1):
    x3.append(abs(x[i+1]-x[i]))
print(gcd2(x3))
Problem p03239 (python)

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

best=-1
best_c=-1
for _ in range(N):
    c,t = map(int,input().split())
    if t <= T:
        if best_c == -1:
            best_c = c
        elif best_c > c:
            best_c = c
if best_c == -1:
    print("TLE")
else: 
    print(best_c)

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

best=-1
best_c=-1
for _ in range(N):
    c,t = map(int,input().split())
    if t <= T:
        if best_c == -1:
            best_c = c
        else if best_c > c:
            best_c = c
if best == -1:
    print("TLE")
else: 
    print(best)
Problem p03238 (python)

Fixed submission:
n = int(input())
if n == 1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy submission (verdict: Runtime Error):
n, T = map(int, input().split())
a = set()
min_ = 1001
for i in range(n):
    c, t = map(int, input().split())
    a.add(c)
    if t <= T and c <= min_:
        min_ = c
    a.remove(c)
if min_ == 1001:
    print('TLE')
else:
    print(min_)

Buggy submission (verdict: Runtime Error):
n, T = map(int, input().split())
a = set()
min_ = 1000
for i in range(n):
    c, t = map(int, input().split())
    a.add(c)
    if t <= T and a[i] <= min_:
        min_ = a[i]
    a.remove(c)
if min_ == 1000:
    print('TLE')
else:
    print(min_)

Buggy submission (verdict: Runtime Error):
n, T = map(int, input().split())
a = []
min_ = 1001
for i in range(n):
    c, t = map(int, input().split())
    a.append(c)
    if t <= T and a[i] <= min_:
        min_ = a[i]
if min_ == 1001:
    print('TLE')
else:
    print(min_)
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
N,T=map(int, input().split())
ct=[]
Nminimum=int(101)
output=str('TLE')
for i in range(N):
    ct.append(list(map(int, input().split())))
for i in range(N):
    if ct[i][1]<=T:
        if ct[i][0]<Nminimum:
            Nminimum=ct[i][0]
            output=Nminimum
print(output)
Problem p03294 (python)

Fixed submission:
N=int(input())
a=list(map(int, input().rstrip().split()))
work=int()
Multiple=int(1)
Output=int(0)
def gcd(x,y):
    while y>0:
        x, y=y, x%y
    return x
for i in range(N):
    Multiple=int((Multiple*a[i])//gcd(Multiple, a[i]))
for i in range(N):
    Output+=(Multiple-1)%a[i]
print(Output)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=list(map(int, input().rstrip().split()))
work=int()
Multiple=int(1)
Output=int(0)
def gcd(x,y):
    while y>0:
        x, y=y, x%y
    return x
for i in range(N):
    Multiple=int((Multiple*a[i])/gcd(Multiple, a[i]))
for i in range(N):
    Output+=(Multiple-1)%a[i]
print(Output)
Problem p03309 (python)

Fixed submission:
N=int(input())
A=list(map(int, input().rstrip().split()))
B=list(A[i]-i for i in range(N))
C=list(A[i]-i for i in range(N))
C.sort()
work=C[N//2]
testA=sum(abs(B[i]-work) for i in range(N))
testB=sum(abs(B[i]-work-1) for i in range(N))
testC=sum(abs(B[i]-work+1) for i in range(N))
output=min(testA,testB,testC)
print(output)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().rstrip().split()))
B=list(A[i]-i for i in range(N))
C=B.sort()
work=C[N//2]
testA=sum(abs(B[i]-work) for i in range(N))
testB=sum(abs(B[i]-work-1) for i in range(N))
testC=sum(abs(B[i]-work+1) for i in range(N))
output=min(testA,testB,testC)
print(output)
Problem p03323 (python)

Fixed submission:
A,B=map(int, input().rstrip().split())
ans=str()
if max(A,B)<9:
    ans="Yay!"
else:
    ans=":("
print(ans)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
ans=str()
if max(A,B)<9:
    ans="Yay!"
else:
    ans=":("
print(ans)
Problem p03239 (python)

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

INF = 10001
minimum = INF
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        minimum = min(minimum, c)

if minimum == INF:
    print('TLE')
else:
    print(minimum)

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

INF = 10001
minimum = INF
for i in range(N):
    c,t = map(int, input())
    if t <= T:
        minimum = min(minimum, c)

if minimum == INF:
    print('TLE')
else
    print(minimum)
Problem p03283 (python)

Fixed submission:
n, m, qq = map(int, input().split())
lr = [[0] * n for _ in range(n)]
for _ in range(m):
    l, r = map(int, input().split())
    lr[l - 1][r - 1] += 1

for i in range(n):
    for j in range(n - 1):
        lr[i][j + 1] += lr[i][j]
for j in range(n):
    for i in range(n-1, 0, -1):
        lr[i - 1][j] += lr[i][j]

for _ in range(qq):
    p, q = map(int, input().split())
    if q == n:
        print(lr[p - 1][q - 1])
    else:
        print(lr[p - 1][q - 1] - lr[q][q - 1])

Buggy submission (verdict: Runtime Error):
n, m, q = map(int, input().split())
cum = [[0]
for i in range(m):
    li, ri = map(int, input().split())
    lis.append(li)
    ris.append(ri)

for i in range(q):
    pi, qi = map(int, input().split())
    total = 0
    for (li, ri) in zip(lis, ris):
        if pi <= li and ri <= qi:
            total += 1
    print(total)
Problem p03448 (python)

Fixed submission:
coin500 = int(input())
coin100 = int(input())
coin50 = int(input())
total = int(input())

ans = 0
for i_500 in range(coin500 + 1):
    for i_100 in range(coin100 + 1):
        for i_50 in range(coin50 + 1):
            if 500 * i_500 + 100 * i_100 + 50 * i_50 == total:
                ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
coin500 = int(input())
coin100 = int(input())
coin50 = int(input())
total = int(input())

ans = 0
for i_500 in range(coin500 + 1):
    for i_100 in range(coin100 + 1):
        for i_50 in range(coin50 + 1):
            if 500 * i_500 + 100 * i_100 + 50 * i_50 = total:
                ans += 1
print(ans)
Problem p03473 (python)

Fixed submission:
n = int(input())
print(48 - n)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = [0] * n
s = [0] * n
f = [0] * n
for i in range(n - 1):
    c[i], s[i], f[i] = map(int, input().split())

for i in range(n - 1):
    total = 0
    for j in range(i, n - 1):
        if total < s[j]:
            total = s[j]
        elif (total - s[j]) % f[j] == 0:
            total += f[j] - total % f[j]
        total += c[j]

    print(total)

print(0)
Problem p03494 (python)

Fixed submission:
n = int(input())
nums = list(map(int, input().split()))
cnt = 0
while all(num % 2 == 0 for num in nums):
    nums = [num / 2 for num in nums]
    cnt += 1
print(cnt)

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

cnt = 0
while all(a % 2 == 0 for i in A):
  A = [a / 2 for a in A]
  cnt += 1
print(cnt)
Problem p03238 (python)

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

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

if N==1:
  print('Hello World')

else:
  print(A+B)
Problem p03239 (python)

Fixed submission:
N,T = map(int,input().split(' '))

clist = []
tlist = []

for _ in range(N):
  L = list(map(int,input().split(' ')))
  clist.append(L[0])
  tlist.append(L[1])
  
List = [c for c,t in zip(clist,tlist) if t<=T]

if len(List):
  print(min(List))
else:
  print('TLE')

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

List = []
 
for _ in range(N):
  list = list(map(int,input().split(' ')))
  List.append(list)
 
List = [x[0] for x in List if x[1]<=T]
  
print(min(List))

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

for _ in range(N):
  list = list(map(int,input().split(' ')))
  List.append(list)

List = [x[0] for x in List if x[1]<=T]
  
print(min(List))
Problem p03251 (python)

Fixed submission:
count = 0
N,M,X,Y = list(map(int,input().split(' ')))
XL = list(map(int,input().split(' ')))
YL = list(map(int,input().split(' ')))
 
for z in range(X+1,Y+1):
  if z>max(X,max(XL)) and z<=min(Y,min(YL)):
    count += 1 

if count>0:
  print('No War')
else:
  print('War')

Buggy submission (verdict: Runtime Error):
count = 0
N,M,X,Y = list(map(int,input().split(' ')))
XL = list(map(int,input().split(' ')))
YL = list(map(int,input().split(' ')))

XL.sort()
YL.sort()

for z range(X+1,Y+1):
	if z>XL[N-1] and z<=YL[0]:
		count = 1 

if count>0:
	print('No war')
else:
	print('war')
Problem p03284 (python)

Fixed submission:
n = list(map(int,input().split(' ')))
s = 1
if n[0]%n[1]==0:
	s-=1
print(s)

Buggy submission (verdict: Runtime Error):
n,k = int(input().split(' '))
s = 1
if n%k==0:
	s-=1
print(s)
Problem p03285 (python)

Fixed submission:
n = int(input())
x = 1+n//4
q = ['No','Yes']
s = 0
for a in range(x):
  if (n-a*4)%7==0:
    s += 1
    break
        
print(q[s])

Buggy submission (verdict: Runtime Error):
n = int(input())
x = 1+n//4
q = ['No','Yes']
s = 0
for a in range(x):
	if (n-a*4)%7==0:
    	s = 1
        
print(q[s])
Problem p03309 (python)

Fixed submission:
import statistics
N = int(input())
L = list(map(int,input().split( )))
f1 = [li-j for li,j in zip(L,range(1+N+1))]
b = statistics.median(f1)
if N%2 != 0:
	ans = sum([abs(li-j-b) for li,j in zip(L,range(1+N+1))])
else:
	b1 = int(b+0.5)
	b2 = int(b-0.5)
	ans1 = sum([abs(li-j-b1) for li,j in zip(L,range(1+N+1))])
	ans2 = sum([abs(li-j-b2) for li,j in zip(L,range(1+N+1))])
	ans = min(ans1,ans2)
print(ans)

Buggy submission (verdict: Runtime Error):
import statistics
N = int(input())
L = list(map(int,input().split( )))
f1 = [li-j for li,j in zip(L,range(1+N+1))]
b = statistics.median(f1)
if N%2 != 0:
	ans = sum([abs(li-j-b) for li,j in zip(L,range(1+N+1))])
else:
	b1 = f1[int(b/2-0.5)]
	b2 = f1[int(b/2+0.5)]
	ans1 = sum([abs(li-j-b1) for li,j in zip(L,range(1+N+1))])
	ans2 = sum([abs(li-j-b2) for li,j in zip(L,range(1+N+1))])
	ans = min(ans1,ans2)
print(ans)
Problem p03323 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a <= 8 and b <= 8:
    print('Yay!')
else:
    print(':(')

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

Fixed submission:
a,b = map(int,input().split( ))
if b!=100:
    for r in range(a):
        b *= 100
else:
    c = b+1
    for r in range(a):
        c *= 100
    b = c
print(b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split( ))
if b!=100:
    x = b*100**a
else:
    101*100**a
print(x)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split( ))
if b!=100:
    x = b*100**a
else:
    101*100**a
print(x)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split( ))
if b!=100:
    x = b*100**a
else:
    101*100**a
print(x)
Problem p03325 (python)

Fixed submission:
count = 0
N = int(input())
L = list(map(int,input().split( )))

for n in range(N):
    for l in range(L[n]):
        if L[n]%2 == 0:
            L[n] /= 2
            count += 1
        else:
            break
            
print(count)

Buggy submission (verdict: Runtime Error):
import functools
import operator

count = 0
N = int(input())
L = list(map(int,input().split( )))

L2 = functools.reduce(operator.mul,L)

for l in range(L2):
    if L2%2 == 0:
        L2 /= 2
        count += 1
    else:
        break

print(count)

Buggy submission (verdict: Runtime Error):
import functools
import operator

count = 0
N = int(input())
L = list(map(int,input().split( )))

L2 = functools.reduce(operator.mul,L)

for l in range(L2):
    if L2%2 == 0:
        L2 /= 2
        count += 1
    else:
        break

print(count)
Problem p03328 (python)

Fixed submission:
x = list(map(int,input().split( )))
z = x[1]-x[0]
t = 0
for s in range(z+1):
    t += s
    
print(t-x[1])

Buggy submission (verdict: Runtime Error):
x,y = map(int,input( ))
z = y-x
t = 0
for s in range(z+1):
    t += s
    
print(t-y)
Problem p03337 (python)

Fixed submission:
s = list(map(int,input().split( )))
x = []
x.append(s[0]+s[1])
x.append(s[0]-s[1])
x.append(s[0]*s[1])
ans = max(x)
print(ans)

Buggy submission (verdict: Runtime Error):
s = list(map(int,input().split( ))
karians = []
karians.append(karians[0]-karians[1])
karians.append(karians[0]+karians[1])
karians.append(karians[0]*karians[1])
ans = max(karians)
print(ans)
Problem p03351 (python)

Fixed submission:
a,b,c,d = list(map(int,input().split( )))

if abs(c-a) <= d or (abs(b-a) <= d and abs(c-b) <= d):
    print('Yes')
else:
    print('No')

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

if abs(c-a) <= d or (abs(b-a) <= d and abs(c-b) <= d):
    print('Yes')
else:
    print('No')
Problem p03369 (python)

Fixed submission:
# -*- coding: utf-8 -*-

a = list(input())
sum = 700
for i in a:
    if i == 'o':
        sum += 100

print(sum)

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

a = input().split("")
sum = 700
for i in a:
    if i == 'o':
        sum += 100

print(sum)
Problem p03288 (python)

Fixed submission:
r = int(input())
if r < 1200:
    print("ABC")
else:
    if r < 2800:
        print("ARC")
    else:
        print("AGC")

Buggy submission (verdict: Runtime Error):
r = int(input())
if r < 1200:
    print(ABC)
    if 1200 <= r <2800:
        print(ARC)
    else:
        print(AGC)
Problem p03239 (python)

Fixed submission:
import numpy as np

dataNum, timeMax = input().strip().split(' ')
dataNum, timeMax = [int(dataNum), int(timeMax)]

cost = [10000]
time = [10000]

"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    cost.append(A)
    time.append(B)

if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))
"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    if B <= timeMax:
        cost.append(A)
        time.append(B)
    
if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))

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

dataNum, timeMax = input().strip().split(' ')
dataNum, timeMax = [int(dataNum), int(timeMax)]

cost = []
time = []

"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    cost.append(A)
    time.append(B)

if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))
"""
for i in range(dataNum):
    A, B = list(map(int, input().strip().split(' ')))   
    if B <= timeMax:
        cost.append(A)
        time.append(B)
    
if min(time) > timeMax:
    print('TLE')
else :
    print(min(cost))
Problem p03239 (python)

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


cost = 10000
res = [0,0]

for i in range(n[0]):
    get = input().split(" ")
    get = list(map(int,get))
    
    if get[1] <= n[1]:
        res[1] = get[1]
        if get[0] < cost:
            cost = get[0]


if res[1]==0:
    print('TLE')
else:print(cost)

Buggy submission (verdict: Runtime Error):
res = [0,0]
for i in range(n[0]):
    get = input().split(" ")
    get = list(map(int,get))
    

    if get[1] < n[1]:
        res[0] = get[0]
        res[1] = get[1]
    
if res[0]==0 and res[1]==0:
    print('TLE')
else:print(res[0])

Buggy submission (verdict: Runtime Error):
res = [0,0]
for i in range(n[0]):
    get = input().split(" ")
    get = list(map(int,get))
    

    if get[1] < n[1]:
        res[0] = get[0]
        res[1] = get[1]
    
if res[0]==0 and res[1]==0:
    print('TLE')
else:print(res[0])
Problem p03238 (python)

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

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

Fixed submission:
A=[]
while True:
    try:
        A.append(list(map(int,input().split())))
              
 
    except:
        break;
#2列めがT以下で且つ、コストが最小なものを抽出
T = A[0][1]
Tc = 0
min = A[1][0] #最小を7とす
 
for i in range(1, len(A)):
  j = int(i)
  if A[j][1] <= T:
    Tc = Tc+1
    if A[j][0] <= min:
      min = A[j][0]
     
      
if Tc == 0:
  print("TLE")
else:
  print(min)

Buggy submission (verdict: Runtime Error):
A=[]
while True:
    try:
        A.append(list(map(int,input().split())))
              

    except:
        break;
#2列めがT以下で且つ、コストが最小なものを抽出
min = A[1][1] #最小を7とす

for i in range(1, len(A)):
  j = int(i)
  if A[j][1] =< A[0][1]:
    if A[j][0] < min:
      min = A[j][0]

if min < A[0][1]:
  print(min)
else:
  print("TLE")
Problem p03316 (python)

Fixed submission:
N=int(input())
dSum=0
tmpN=N
while tmpN>=1:
    dSum += tmpN % 10
    tmpN = int(tmpN/10)
#print(dSum)
if N % dSum == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
dSum=0
tmpN=N
while tmpN>=10:
    dSum+=tmpN%10
    tmpN/=10
if N%dSum==0:
    print("Yes")
else:
    print("No")
Problem p03475 (python)

Fixed submission:
N=int(input())
C,S,F=[0]*(N-1),[0]*(N-1),[0]*(N-1)
for i in range(N-1):
    C[i],S[i],F[i]=map(int,input().split())
for i in range(N-1): #一周につき一つの駅([0]..[N-2])から[N-1]までの計算
    arrivalTime=S[i]+C[i]#最初発車駅の次の駅に着く時間
    for j in range(i+1,N-1):
        leaveTime=S[j]#現在考慮中の駅から初めて発車する時間
        if arrivalTime <leaveTime:
            pass
        elif arrivalTime % F[j]==0:
            leaveTime=arrivalTime
        else:
            leaveTime=arrivalTime+F[j]- arrivalTime % F[j]
        '''
        while arrivalTime > leaveTime:
            leaveTime+=F[j]
        '''
        arrivalTime=leaveTime+C[j]
    print(arrivalTime)
print(0)#[N-1]駅

Buggy submission (verdict: Runtime Error):
N=int(input())
C,S,F=[0]*(N-1),[0]*(N-1),[0]*(N-1)
for i in range(N-1):
    C[i],S[i],F[i]=map(int,input().split())
for i in range(N-1): #一周につき一つの駅([0]..[N-2])から[N-1]までの計算
    arrivalTime=S[i]+C[i]#最初発車駅の次の駅に着く時間
    for j in range(i+1,N-1):
        leaveTime=S[j]#現在考慮中の駅から初めて発車する時間
        if arrivalTime <leaveTime:
            pass
        elif arrivalTime % F[j]==0:
            leaveTime=arrivalTime
        else:
            leaveTime=arrivalTime+F[j]- arrivalTime % F[j]-
        '''
        while arrivalTime > leaveTime:
            leaveTime+=F[j]
        '''
        arrivalTime=leaveTime+C[j]
    print(arrivalTime)
print(0)#[N-1]駅