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

Fixed submission:
N ,W = map(int,input().split())
L = []
for _ in range(N):
    l = list(map(int,input().split()))
    L.append(l)
dp = [[0 for _ in range(W + 10)] for _ in range(N + 10)]
for i in range(N):
    for w in range(W+1):
        if w+L[i][0] <= W:
            dp[i+1][w+L[i][0]] =max(dp[i][w]+L[i][1], dp[i+1][w+L[i][0]])
        dp[i+1][w] = max(dp[i][w], dp[i+1][w])
ans = 0
for w in range(W+1):
    ans = max(ans,dp[N][w])
print(ans)

Buggy submission (verdict: Runtime Error):
N ,W = map(int,input().split())
L = []
for _ in range(N):
    l = list(map(int,input().split()))
    L.append(l)
dp = [[0 for _ in range(N + 10)] for _ in range(W + 10)]
for i in range(N):
    for w in range(W+1):
        if w+L[i][0] <= W:
            dp[i+1][w+L[i][0]] =max(dp[i][w]+L[i][1], dp[i+1][w+L[i][0]])
        dp[i+1][w] = max(dp[i][w], dp[i+1][w])
ans = 0
for w in range(W+1):
    ans = max(ans,dp[N][w])
print(ans)

Buggy submission (verdict: Runtime Error):
N ,W = map(int,input().split())
L = []
for _ in range(N):
    l = list(map(int,input().split()))
    L.append(l)
dp = [[0 for _ in range(N + 10)] for _ in range(W + 10)]
for i in range(N):
    for w in range(W+1):
        if w+L[i][0] <= W:
            dp[i+1][w+L[i][0]] =max(dp[i][w]+L[i][1], dp[i+1][w+L[i][0]])
        dp[i+1][w] = max(dp[i][w], dp[i+1][w])
ans = 0
for w in range(W+1):
    ans = max(ans,dp[N][w])
print(ans)
Problem p03164 (python)

Fixed submission:
N,W = map(int,input().split())
w = []
v = []
for _ in range(N):
    x,y = map(int,input().split())
    w.append(x)
    v.append(y)
dp = [[10000000000000 for _ in range(2001 * N + 10)] for _ in range(N + 2) ]
ans = 0
for i in range(N):
    dp[i][0] = 0
for i in range(N):
    for j in range(N * 1000):
      	
        dp[i + 1][j + v[i]] = min(dp[i+1][j+v[i]],dp[i][j]+w[i])
        dp[i+1][j] = min(dp[i+1][j],dp[i][j])
for i in range(N * 1000 + 1):
    if dp[N][i] <= W:
        ans = max(ans,i)
print(ans)

Buggy submission (verdict: Runtime Error):
N,W = map(int,input().split())
w = []
v = []
for _ in range(N):
    x,y = map(int,input().split())
    w.append(x)
    v.append(y)
dp = [[10000000000000 for _ in range(1000 * N + 10)] for _ in range(N + 1) ]
ans = 0
for i in range(N):
    dp[i][0] = 0
for i in range(N):
    for j in range(N * 1000):
        dp[i + 1][j + v[i]] = min(dp[i+1][j+v[i]],dp[i][j]+w[i])
        dp[i+1][j] = min(dp[i+1][j],dp[i][j])
for i in range(N * 1000 + 1):
    if dp[N][i] <= W:
        ans = max(ans,i)
print(ans)

Buggy submission (verdict: Runtime Error):
N,W = map(int,input().split())
w = []
v = []
for _ in range(N):
    x,y = map(int,input().split())
    w.append(x)
    v.append(y)
dp = [[10000000000000 for _ in range(100 * N + 10)] for _ in range(110) ]
ans = 0
for i in range(N):
    dp[i][0] = 0
for i in range(N):
    for j in range(N * 100):
        dp[i + 1][j + v[i]] = min(dp[i+1][j+v[i]],dp[i][j]+w[i])
        dp[i+1][j] = min(dp[i+1][j],dp[i][j])
for i in range(N * 100 + 1):
    if dp[N][i] <= W:
        ans = max(ans,i)
print(ans)

Buggy submission (verdict: Runtime Error):
N,W = map(int,input().split())
w = []
v = []
for _ in range(N):
    x,y = map(int,input().split())
    w.append(x)
    v.append(y)
dp = [[10000000000000 for _ in range(100 * N + 10)] for _ in range(110) ]
ans = 0
for i in range(N):
    dp[i][0] = 0
for i in range(N):
    for j in range(N * 100):
        dp[i + 1][j + v[i]] = min(dp[i+1][j+v[i]],dp[i][j]+w[i])
        dp[i+1][j] = min(dp[i+1][j],dp[i][j])
for i in range(N * 100 + 1):
    if dp[N][i] <= W:
        ans = max(ans,i)
print(ans)
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10000000)

V, M = map(int,input().split())
L = [[] for _ in range(V+1)]
DP = [-1 for _ in range (V + 2)]
for _ in range(M):
    x,y = map(int,input().split())
    L[x-1].append(y-1)

def rec(v):
    if DP[v] != -1: return DP[v]
    ret = 0
    for x in L[v]:
        ret = max(ret,rec(x)+1)
    DP[v] = ret
    return DP[v]
ans = 0
for i in range(V):
    ans = max(ans, rec(i))
print(ans)

Buggy submission (verdict: Runtime Error):
V, M = map(int,input().split())
L = [[] for _ in range(V+1)]
DP = [-1 for _ in range (V + 2)]
for _ in range(M):
    x,y = map(int,input().split())
    L[x-1].append(y-1)

def rec(v):
    if DP[v] != -1: return DP[v]
    ret = 0
    for x in L[v]:
        ret = max(ret,rec(x)+1)
    DP[v] = ret
    return DP[v]
ans = 0
for i in range(V):
    ans = max(ans, rec(i))
print(ans)
Problem p03200 (python)

Fixed submission:
N = input()
cnt1 = 0
for x in N:
  if x == 'B':
    cnt1 += 1
N = N[::-1]
ans =  0
cnt2 = 0
for i in range(len(N)):
  if N[i] == 'B':
    ans += i - cnt2
    cnt2 += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
cnt1 = 0
for x in N:
  if x == 'B':
    cnt1 += 1
N = N[::-1]
ans =  0
cnt2 = 0
for i in range(N):
  if N[i] == 'B':
    ans += i - cnt2
    cnt2 += 1
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())
s = sorted(S)[::-1]
B = []
W = []

for i in range(len(S)):
    if S[i] == 'B':
        B.append(i)
    else:
        W.append(i)

W = W[::-1]
#print(B,W)
cnt = 0
while True:
    if B == [] :
        break
    tmpB = B.pop(0)
    tmpW = W.pop(0)
    if tmpB >= tmpW:
        break
    cnt += tmpW - tmpB
    W.append(tmpB)
print(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input())
s = sorted(S)[::-1]
B = []
W = []

for i in range(len(S)):
    if S[i] == 'B':
        B.append(i)
    else:
        W.append(i)

W = W[::-1]
#print(B,W)
cnt = 0
while True:
    if B == [] :
        break
    tmpB = B.pop(0)
    tmpW = W.pop(0)
    if tmpB >= tmpW:
        break
    cnt += tmpW - tmpB
    W.append(tmpB)
print(cnt)

Buggy submission (verdict: Runtime Error):
S = list(input())
s = sorted(S)[::-1]
B = []
W = []

for i in range(len(S)):
    if S[i] == 'B':
        B.append(i)
    else:
        W.append(i)

W = W[::-1]
#print(B,W)
cnt = 0
while True:
    if B == [] :
        break
    tmpB = B.pop(0)
    tmpW = W.pop(0)
    if tmpB >= tmpW:
        break
    cnt += tmpW - tmpB
    W.append(tmpB)
print(cnt)
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
L = []
for _ in range(N):
    l = list(map(int,input().split()))
    if l[2] != 0:
        L.append(l)
#print(L)

for i in range(101):
    for j in range(101):
        tmp = -1
        for x in L:
            H = abs(x[0]-i) + abs(x[1]-j) + x[2]
            if H < 1:
                break
            if tmp != -1 and tmp != H:
                break
            else:
                tmp = H
        else:
            for x in L:
                if x[2]==max(0,H-abs(x[0]-i)-abs(x[1]-j)):
                    pass
                else:
                    break
            else:
                print(i,j,H)

Buggy submission (verdict: Runtime Error):
N = input()
if N == 1:
  print('Hello World')
else :
  a = input()
  b = input()
  print(int(a) + int(b))

Buggy submission (verdict: Runtime Error):
N = input()
if N == 1:
  print('Hello World')
else :
  a = input()
  b = input()
  print(a + b)
Problem p03239 (python)

Fixed submission:
a, b = map(int, input().split())
l = []
for _ in range(a):
  x, y = map(int, input().split())
  if y <= b:
    l.append(x)
if l == []:
  print('TLE')
else:
  print(min(l))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
l = []
for _ in range(a):
  x, y = map(int, input().split())
  if y <= b:
    l.append(x)
print(min(l))
Problem p03244 (python)

Fixed submission:
n = int(input())
ans = []
L = list(map(int,input().split()))
if len(list(filter(lambda x:x==L[0] ,L))) == len(L):
    print(n//2)
    quit()


import collections as col
L1 = L[::2]
L2 = L[1::2]
c1 = sorted(list(col.Counter(L1).items()),key=lambda x:x[1])[::-1]
c2 =sorted(list(col.Counter(L2).items()),key=lambda x:x[1])[::-1]

for i in range(3):
    for j in range(3):
        try:
            tmp1 = c1[i][0]
            tmp2 = c2[j][0]
            if tmp1 == tmp2 :
                continue
            a1 = n//2 - c1[i][1]
            a2 = n//2 - c2[j][1]
            ans.append(a1+a2)
        except:
            pass
print(min(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = []
L = list(map(int,input().split()))
if len(list(filter(lambda x:x==L[0] ,L))) == len(L):
    print(n//2)
    quit()


import collections as col
L1 = L[::2]
L2 = L[1::2]
c1 = list(col.Counter(L1).items())
c2 = list(col.Counter(L2).items())

for i in range(2):
    for j in range(2):
        tmp1 = c1[i][0]
        tmp2 = c2[j][0]
        if tmp1 == tmp2 :
            continue
        a1 = n//2 - c1[i][1]
        a2 = n//2 - c1[j][1]
        ans.append(a1+a2)
print(min(ans))
Problem p03262 (python)

Fixed submission:

import math
from functools import reduce
a,b=input().split()
l=sorted([abs(int(x)-int(b)) for x in input().split()])

def gcd(a,b):
    if a < b:
        a,b = b,a
    if  b==0:
        return a
    c = a % b
    return gcd(b,c)
while len(l)!=1:
    l.append(gcd(l.pop(0),l.pop(-1)))
print(sum(l))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
a,b=input().split()
l=sorted([int(x)-int(b) for x in input().split()])
print(abs(reduce(math.gcd, l)))

Buggy submission (verdict: Runtime Error):

import math
from functools import reduce
a,b=input().split()
l=sorted([int(x)-int(b) for x in input().split()])
print(abs(reduce(math.gcd, l)))
Problem p03273 (python)

Fixed submission:
H,W = map(int,input().split())
L = []


for _ in range(H):
    s=input()
    l=[]
    for x in s:
        l.append(x)
    for x in l:
        if x == ".":
            pass
        else:
            L.append(l)
            break
delete=[]
cou=0
for i in range(W):
    cnt = 0
    for j in range(len(L)):
        if L[j][i]  == '.':
            cnt += 1
        else:
            cnt = 0
    if cnt == len(L):
        delete.append(i-cou)
        cou+=1
for i in delete:
    for j in range(len(L)):
        del L[j][i]

for x in L:
    for y in x:
        print(y,end="")
    print()

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
L = []


for _ in range(H):
    s=input()
    l=[]
    for x in s:
        l.append(x)
    for x in l:
        if x == ".":
            pass
        else:
            L.append(l)
            break
delete=[]
for i in range(W):
    cnt = 0
    for j in range(len(L)):
        if L[j][i]  == '.':
            cnt += 1
        else:
            cnt = 0
    if cnt == len(L):
        delete.append(i)
for i in delete:
    for j in range(len(L)):
        del L[j][i]
for x in L:
    for y in x:
        print(y,end="")
    print()
Problem p03292 (python)

Fixed submission:
L = list(map(int,input().split()))
L = sorted(L)
ans = 0
ans += L[2]-L[1]
ans += L[1]-L[0]
print(ans)

Buggy submission (verdict: Runtime Error):
L = list(map(int,input().split()))
L = sorted(L)
ans += L[2]-L[1]
ans += L[1]-L[0]
print(ans)
Problem p03309 (python)

Fixed submission:
N = int(input())
L = list(map(int,input().split()))
for i in range(N):
    L[i] = L[i] - (i+1)
L = sorted(L)
#print(L)
ans = 0
n=len(L)
med = int(L[(n+1)//2-1])
#print(med)
for i in range(N):
    ans+=abs(L[i]-med)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int,input().split()))
for i in range(N):
    L[i] = L[i] - (i+1)
L = sorted(L)
#print(L)
ans = 0
import statistics 
med = int(statistics.median(L))
#print(med)
for i in range(N):
    ans+=abs(L[i]-med)
print(ans)
Problem p03352 (python)

Fixed submission:
X = int(input())
L=[]
for i in range(2,11):
    for j in range(1001):
        if j**i > 1000:
            break
        if  j**i not  in L:
            L.append(j**i)
L=sorted(L)

if  X not in L:
    L.append(X)
    L=sorted(L)
    n = L.index(X)
    print(L[n-1])
else:
    print(X)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
L=set()
for i in range(5):
    for j in range(len(S)-i):
        L.add((S[j:j+i+1]))
L = sorted(list(L))
print(L[K-1])
Problem p03359 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input()) 
prime = [] 
def isprime(n):
    flag = 0
    for i in range(2,int(n**(1/2))+1):
        if n % i == 0:
            flag = 1
            break
    if n == 2:
        flag = 0
    if flag == 0:
        return True
    else:
        return False 
for i in range(1,55556):
    if isprime(i) and i%5==1:
        prime.append(i) 
ans = str(prime[1] )
for i in range(2,N+1):
    ans += " "+str(prime[i] )
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
prime = []

def isprime(n):
    flag = 0
    for i in range(2,int(n**(1/2))+1):
        if n % i == 0:
            flag = 1
            break
    if n == 2:
        flag = 0
    if flag == 0:
        return True
    else:
        return False
for i in range(1,55556):
    if isprime(i) and i%5==1:
        prime.append(i)
ans = ""
for i in range(1,N+1):
  ans += prime[i]
print(ans)
Problem p03360 (python)

Fixed submission:
L = [list(map(int,input().split()))]
K = int(input())
import copy

def peice_double(L):
    l = []
    for x in L:
        tmp = copy.copy(x)
        for i in range(3):
            tmp[i] = tmp[i] * 2
            l.append(copy.copy(tmp))
            tmp[i] = tmp[i] // 2
    return l
for i in range(K):
    L = peice_double(L)
ans = 0
for x in L:
    ans = max(ans, sum(x))
print(ans)

Buggy submission (verdict: Runtime Error):
L = list(map(int,input().split()))
K = int(input())
m = max(L)
print(L-m + m* (2 ** K))

Buggy submission (verdict: Runtime Error):
L = list(map(int,input().split()))
K = int(input())
m = max(L)
print(L-m + m* (2 ** k))

Buggy submission (verdict: Runtime Error):
L = list(map(int,input().split()))
K = int(input())
max = max(L)
print(L-max + max* (2 ** k))

Buggy submission (verdict: Runtime Error):
L = map(int,input().split())
K = int(input())
max = max(L)
print(L-max + max* (2 ** k))
Problem p03362 (python)

Fixed submission:
N = int(input()) 
prime = [] 
def isprime(n):
    flag = 0
    for i in range(2,int(n**(1/2))+1):
        if n % i == 0:
            flag = 1
            break
    if n == 2:
        flag = 0
    if flag == 0:
        return True
    else:
        return False 
for i in range(1,55556):
    if isprime(i) and i%5==1:
        prime.append(i) 
ans = str(prime[1] )
for i in range(2,N+1):
    ans += " "+str(prime[i] )
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
prime = []

def isprime(n):
    flag = 0
    for i in range(2,int(n**(1/2))+1):
        if n % i == 0:
            flag = 1
            break
    if n == 2:
        flag = 0
    if flag == 0:
        return True
    else:
        return False
for i in range(1,55556):
    if isprime(i) and i%5==1:
        prime.append(i)
ans = prime[1]
for i in range(2,N+1):
  ans += " "+prime[i] 
print(ans)
Problem p03369 (python)

Fixed submission:
s = input()
ans = 0
for x in s:
  if x == 'o':
    ans += 1
print(700+ans*100)

Buggy submission (verdict: Runtime Error):
s = input()
for x in s:
  if x == 'o':
    ans += 1
print(700+ans*100)
Problem p03370 (python)

Fixed submission:
N, X = map(int,input().split())
l = []
for _ in   range(N):
    l.append(int(input()))
X = X - sum(l)
cnt = X // min(l)
print(N+cnt)

Buggy submission (verdict: Runtime Error):
A, B, C, X, Y = map(int,input().split())
value = 0
ans = []
if X > 0 and Y > 0 and A + B > 2*C:
    m = min(X, Y)
    value += m * 2*C
    X = X - m
    Y = Y - m
value += (X * A + Y * B)
ans.append(value)
ans.append(max(X,Y) * 2*C)
print(min(ans))
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())
ans = []
for i in range(K):
  ans.append(A + i)
for i in range(1,K+1):
  if B-(K-i) not in ans:
    ans.append(B-(K-i))
for x in ans:
  if A <= x and x <= B:
    print(x)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
ans = set()
L = [i for i in range(A, B+1)]
for i in range(K):
  ans.add(L[i])
  ans.add(L[len(L) - 1 - i ])
ans = sorted(list(ans))
for x in ans:
  print(x)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
ans = set()
L = [i for i in range(A, B+1)]
for i in range(K):
  ans.add(L[i])
  ans.add(L[len(L - 1) - i ])
ans = sorted(list(ans))
for x in ans:
  print(x)
Problem p03387 (python)

Fixed submission:
A, B, C = map(int, input().split())
cnt = 0
if A % 2 == B % 2 and B % 2 != C % 2:
  A += 1
  B += 1
  cnt += 1
elif A % 2 == C % 2  and C % 2 != B % 2 :
  A += 1
  C += 1
  cnt += 1
elif C % 2 == B % 2 and A % 2 != C %2 :
  C += 1
  B += 1
  cnt += 1
else :
  pass
L = [A, B, C]
L= sorted(L)
cnt += (L[2] - L [1])//2
cnt += (L[2] - L[0])//2
print(cnt)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
cnt = 0
if A % 2 == B % 2 and B % 2 != C % 2:
  A += 1
  B += 1
  cnt += 1
elif A % 2 == C % 2  and C % 2 != B % 2 :
  A += 1
  B += 1
  cnt += 1
elif C % 2 == B % 2 and A % 2 != C %2 :
  C += 1
  B += 1
  cnt += 1
else :
  pass
L = [A, B, C]
L= soreted(L)
cnt += (L[2] - L [1])//2
cnt += (L[2] - L[0])//2
print(cnt)
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 50*i + 100*j = 500*k == X:
        ans += 1
print(ans)
Problem p03472 (python)

Fixed submission:
N, H = map(int,input().split())
L = []
maxi = 0
for _ in range(N):
    a,b = map(int,input().split())
    maxi = max(maxi, a)
    L.append((a,b))
cand = []
throw = 0
cnt = 0
for l in L:
    if maxi <  l[1]:
        throw += l[1]
        cand.append(l[1])
        cnt += 1
import math
if H - throw > 0: 
    print(math.ceil((H - throw)/maxi) + cnt )
else:
    throw = 0
    cnt = 0
    cand.sort()
    for x in cand[::-1]:
        throw += x
        cnt += 1
        if throw >= H:
            print(cnt)
            quit()

Buggy submission (verdict: Runtime Error):
N, H = map(int,input().split())
L = []
maxi = 0
for _ in range(N):
    a,b = map(int,input().split())
    maxi = max(maxi, a)
    L.append(b)
from itertools import accumulate
accumulated =  list(accumulate(\
    sorted([x for x in L if x > maxi],reverse=True) ))
from bisect import bisect_left
from math import ceil
if H - accumulated[-1]  > 0 :
    print(ceil((H - accumulated[-1]) / maxi) + len(accumulated))
else:
    index = bisect_left(accumulated,H)
    print(index + 1)

Buggy submission (verdict: Runtime Error):
N, H = map(int,input().split())
L = []
maxi = 0
for _ in range(N):
    a,b = map(int,input().split())
    maxi = max(maxi, a)
    L.append(b)
from itertools import accumulate
accumulated =  list(accumulate(\
    sorted([x for x in L if x > maxi],reverse=True) ))
from bisect import bisect_right
from math import ceil
if H - accumulated[-1]  > 0 :
    print(ceil((H - accumulated[-1]) / maxi) + len(accumulated))
else:
    index = bisect_right(accumulated,H)
    print(index)
Problem p03473 (python)

Fixed submission:
I = int(input())
print(24+24-I)

Buggy submission (verdict: Runtime Error):
I = int(intput())
print(24+24-I)
Problem p03475 (python)

Fixed submission:
N = int(input())
train = [[] for _ in range(N)]
L = []
for cnt in range(N - 1):
    l = list(map(int,input().split()))
    L.append(l)

from math import ceil

from bisect import bisect_left
for place in range(N):
    now = 0
    for i in range(place,N - 1):
        k = max(0,ceil((now - L[i][1]) / L[i][2]))
        now = L[i][1] + L[i][2] * k
        now += L[i][0]
    print(now)

Buggy submission (verdict: Runtime Error):
N = int(input())
train = [[] for _ in range(N)]
take_time = []
for cnt in range(N - 1):
    x, y , z = map(int,input().split())
    take_time.append(x)
    for _ in range(15001 ) :
        train[cnt].append(y)
        y += z

from bisect import bisect_left
for place in range(N):
    now = 0
    for i in range(place,N - 1):
        index = bisect_left(train[i],now)
        now = train[i][index]
        now += take_time[i]
    print(now)

Buggy submission (verdict: Runtime Error):
N = int(input())
train = [[] for _ in range(N)]
take_time = []
for cnt in range(N - 1):
    x, y , z = map(int,input().split())
    take_time.append(x)
    for _ in range(10**3):
        train[cnt].append(y)
        y += z

from bisect import bisect_left
for place in range(N):
    now = 0
    for i in range(place,N - 1):
        index = bisect_left(train[i],now)
        now = train[i][index]
        now += take_time[i]
    print(now)

Buggy submission (verdict: Runtime Error):
N = int(input())
train = [[] for _ in range(N)]
take_time = []
for cnt in range(N - 1):
    x, y , z = map(int,input().split())
    take_time.append(x)
    for _ in range(10**4):
        train[cnt].append(y)
        y += z

from bisect import bisect_left
for place in range(N):
    now = 0
    for i in range(place,N - 1):
        index = bisect_left(train[i],now)
        now = train[i][index]
        now += take_time[i]
    print(now)
Problem p03493 (python)

Fixed submission:
N = input()
ans = 0
for x in N:
  if x == '1':
    ans += 1
  else:
    pass
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
ans = 0
for x in N:
  if x == '1'
    ans += 1
  else:
    pass
print(ans)
Problem p03550 (python)

Fixed submission:
N, Z, W = map(int,input().split())
A = list(map(int,input().split()))
idea = abs(A[-1] - W)
try: idea2 = abs(A[-2] - A[-1])
except:
    print(idea)
    quit()
print(max(idea,idea2))

Buggy submission (verdict: Runtime Error):
N, Z, W = map(int,input().split())
A = list(map(int,input().split()))
idea = abs(A[-1] - W)
idea2 = abs(A[-2] - A[-1])
print(max(idea,idea2))
Problem p03555 (python)

Fixed submission:
s1=input()
s2=input()
if s1[0] == s2[2] and s1[1]==s2[1] and s1[2]==s2[0]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
def bisect_left(array, i, left, right):
    n = right - left + 1
    mid = (left+right) // 2
    if n == 1:
        if array[mid] < i:
            return 1
        else:
            return 0
    if i <= array[mid]:
        return bisect_left(array,i,left,mid)
    else:
        return (mid-left+1) + bisect_left(array,i,mid+1,right)

def bisect_right(array, i, left, right):
    n = right - left + 1
    mid = (right+left) // 2
    if n == 1:
        if i < array[mid] :
            return 0
        else:
            return 1
    if array[mid] <= i:
        return  (mid-left+1) + bisect_right(array,i,mid+1,right)
    else:
        return bisect_right(array,i,left,mid)

N = int(input())
L = []
for _ in range(3):
    l = list(map(int,input().split()))
    L.append(sorted(l))
ans = 0
for x in L[1]:
    n = bisect_left(L[0],x,0,N-1)
    m = bisect_right(L[2],x,0,N-1)
    m = N - m
    ans += n*m
print(ans)

Buggy submission (verdict: Runtime Error):
s1=input()
s2=input()
if s1[0] == s2[2] and s1[1]==s2[1] and s1[2]==s[0]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s1=input()
s2=input()
if s1[0] == s2[2] and s1[1]==s2[1] and s1[2]==s[1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s1=input()
s2=input()
if s1[0] == s2[2] and s1[1]==s2[1] ans s1[2]==s[1]:
  print("Yes")
else:
  print("No")