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

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(max(a+b, a-b, a*b))
Problem p03338 (python)

Fixed submission:
n = int(input())
s = input()

max_diff = 0
for i in range(1, len(s)):
  s1 = s[:i]
  s2 = s[i:]
  diff = len(set(s1) & set(s2))
  if diff > max_diff:
    max_diff = diff
print(max_diff)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()

max_diff = 0
for i in range(1, len(s)):
  s1 = s[:i]
  s2 = s[i:]
  diff = len(set(s1) & set(s2))
  if diff > max_diff:
    max_diff = diff
print max_diff
Problem p03105 (python)

Fixed submission:
class Solution:
  def solve(self, A, B, C):
    count = 0
    while True:
      B -= A
      if B < 0: break
      count += 1
      if count == C: return C
    return count

def main():
  inputs = list(map(int, input().split()))
  A, B, C = inputs
  print(Solution().solve(A, B, C))
        
if __name__ == "__main__":
   main()

Buggy submission (verdict: Runtime Error):
class Solution:
  def solve(self, A, B, C):
    count = 0
    spent = 0
    while B >= 0:
      B -= A
      count += 1
      if count == C:
        return C
    return count

def main():
  A = int(input())
  B = int(input())
  C = int(input())
  print(Solution().solve(A, B, C))
        
if __name__ == "__main__":
   main()
Problem p03105 (python)

Fixed submission:
A, B, C = map(int, input().split())

if B/A >= C:
  print(C)
else:
  print(B//A)

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

if A/B >= C:
  print(C)
else:
  print(A/B)
Problem p03106 (python)

Fixed submission:
A, B, K = map(int, input().split())
divideCount = 0
answer = 0

for i in range(100, 0, -1):
  if A % i == 0 and B % i == 0:
    divideCount += 1
    if divideCount == K:
      answer = i

print(answer)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
max = 0
if A > B:
  max = A
else:
  max = B
divideCount = 0

for i in range(1, max):
  if A % i == 0 and B % i == 0:
    if divideCount == K:
      print(i)
      return
    else:
      divideCount += 1

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
max = max([A, B])
divideCount = 0

for i in range(1, max):
  if A % i == 0 and B % i == 0:
    if divideCount == K:
      print(i)
      return
    else:
      divideCount += 1

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
max = max([A, B])
divideCount = 0

for i in range(1, max):
  if A % i == 0 && B % i == 0:
    if divideCount == K:
      print(i)
      return
    else:
      divideCount += 1
Problem p03494 (python)

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

count = 0
can = True
while can:
  for i in range(0, int(n)):
    a = list[i]
    if a % 2 == 0:
      list[i] = a / 2
    else:
      can = False
  if can == True:
    count += 1
print(count)

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

count = 0
can = True
while can:
  for i in range(0, n):
    a = list[i]
    if a % 2 == 0:
      list[i] = a / 2
    else:
      can = False
  if can == True:
    count += 1
print(count)

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

count = 0
can = True
while can:
  for i in range(0, 6):
    a = list[i]
    if a % 2 == 0:
      list[i] = a / 2
    else:
      can = False
  if can == True:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = input()
list = input().split()

count = 0
can = True
while can:
  for i in range(0, 6):
    a = int(list[i])
    if a % 2 == 0:
      list[i] = a / 2
    else:
      can = False
  if can == True:
    count += 1
print(count)
Problem p03106 (python)

Fixed submission:
temp = []
a,b,k = map(int,input().split())
for i in range (1, min(a,b)+1):
  if a%i==0 and b%i==0:
    temp.append(i)
print(temp[-k])

Buggy submission (verdict: Runtime Error):
temp = []
a,b,k = map(int,input().split())
for i in range (1, min(a,b)):
  if a%i==0 and b%i==0:
    temp.append(i)
print(temp[-k])

Buggy submission (verdict: Runtime Error):
temp = []
a,b,k = map(int,input().split())
for i in range (1, min(a,b)):
  if a%i==0 and b%i==0:
    temp.append(i)
print(temp[k-1])

Buggy submission (verdict: Runtime Error):
temp = []
a,b,k = map(int,input().split())
for i in range (1, min(a,b)):
  if a%i==0 and b%i==0:
	temp.append(i)
print(temp[k])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
c=1
d=0
while d<k:
  if a%c==0 and b%c==0:
	d+=1
  else:
	c+=1
print(c)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
c=1
d=0
while d<k:
  if a%c==0 and b%c==0:
	d+=1
  else
	c+=1
print(c)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
c=2
d=0
while d<k:
  if a%c==0 and b%c==0:
	d+=1
  else
	c+=1
print(d)
Problem p03136 (python)

Fixed submission:
N = int(input())
L = list(map(int,input().split()))
if max(L) < (sum(L) - max(L)):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(input()) for L in range(N)]
if max(L) < (sum(L) - max(L)):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(input()) for L in range(N-1)]
if max(L) < (sum(L) - max(L)):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(input()) for L in range(N)]
if max(L) < sum(L) - max(L):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(input()) for i in range(N)]
if max(L) < sum(L) - max(L):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(input()) for i in range(N-1)]
if max(L) < sum(L) - max(L):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [int(input()) for i in range(N)]
if max(i) < sum(i) - max(i):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [for i in range(N-1)]
if max(i) < sum(i) - max(i):
    print('Yes')
else:
    print('No')
Problem p03206 (python)

Fixed submission:
D = int(input())
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
elif D == 22:
    print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
D=int(input())
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
elif D == 22:
    pribt('Christmas Eve Eve Eve')
Problem p03210 (python)

Fixed submission:
x=int(input())
if x==7:
    print('YES')
elif x==5:
    print('YES')
elif x==3:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
x=int(input())
if x= 7:
    print('yes')
elif x=5:
    print('yes')
elif x=3:
    print('yes')
else:
    print('no')
Problem p03220 (python)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
H = list(map(int,input().split()))
t = [abs(T - H[i]*0.006-A) for i in range(N)]
print(t.index(min(t))+1)

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

for i in H:
    temp = T-i*0.006-A
print(min(temp))
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())
if N==1:
    print('Hello World')
else:
    A,B=map(int,input().split())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N==1:
    print('Hello World')
else:
    A,B=map(int,input().split())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N==1:
    print('Hello World')
elif N==2:
    A,B=map(int,input().split())
    print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
if N==1:
    print('Hello World')
elif N==2:
    A,B=map(int,input().split())
    print('A+B')

Buggy submission (verdict: Runtime Error):
N=int(input())
A,B=map(int,input().split())
if N==1:
    print('Hello World')
elif N==2:
    print('A+B')
Problem p03251 (python)

Fixed submission:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
Z=min(y)
if X<Z<=Y and max(x)<Z and min(y)>=Z :
    print('No War')
else:
    print('War')

Buggy submission (verdict: Runtime Error):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
if X<Z<=Y and max(x)<Z and min(y)>=Z :
    print('No War')
else:
    print('War')
Problem p03281 (python)

Fixed submission:
N = int(input())
if N < 105:
    print(int(0))
elif 105<=N<135:
    print(int(1))
elif 135<=N<165:
    print(int(2))
elif 165<=N<189:
    print(int(3))
elif 189<=N<195:
    print(int(4))
else:
    print(int(5))

Buggy submission (verdict: Runtime Error):
N = int(input())
if N < 105:
    print(int(0))
elif 105<=N<135:
    print(int(1))
elif 135<=N<165:
    print(int(2))
elif 165<=N<189
    print(int(3))
elif 189<=N<195
    print(int(4))
else:
    print(int(4))
Problem p03351 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
if abs(c-a)<= d:
    print('Yes')
elif abs(b-a)<=d and abs(c-b)<=d:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
x=int(input())
l=[]
for b in range (1,32):
    for i in range (2,10):
        if b**i <=x:
            l.append (b**i)
print(max(l))
Problem p03352 (python)

Fixed submission:
x=int(input())
l=[]
for b in range (1,32):
    for i in range (2,10):
        if b**i <=x:
            l.append (b**i)
print(max(l))

Buggy submission (verdict: Runtime Error):
x=int(input())
l=[]
for b in range (2,32):
    for i in range (1,10):
        if b**i <=x:
            l.append (b**i)
print(max(l))

Buggy submission (verdict: Runtime Error):
x=int(input())
l=[]
for b in range (2,32):
    for i in range (1,10):
        if b**i <=x:
            l.apprnd b**i
print(max(l))

Buggy submission (verdict: Runtime Error):
x=int(input())
l=[]
for b in range (2,32):
    for i in range (1,10):
        if b**i <=x:
            l.apprnd b**j
print(max(l))
Problem p03106 (python)

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

count = 0
for i in range(min(a,b), 0, -1):
  if a%i==0 and b%i==0:
    count+=1
  if count==c:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
for i in range(min(a,b), 0, -1):
  if a%i==0 and b%i==0:
    count+=1
  if count==c:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
for i in range(min(a,b), 0, -1):
  if a%i==0 and b%i==0:
    count+=1
  if count==c:
    print(i)
Problem p03106 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
ans=[]
for i in range(1,min(A,B)):
  if A%i==0 and B%i==0:
    ans.append(i)
print(ans[-K])
Problem p03105 (python)

Fixed submission:
A,B,C = [int(_) for _ in input().split()]
n = min(B//A,C)
print(n)

Buggy submission (verdict: Runtime Error):
A,B,C = [int(_) for _ in input().split]
n = min(B//A,C)
print(n)
Problem p03106 (python)

Fixed submission:
A,B,K = [int(_) for _ in input().split()]
c = 0
i = 100
while True:
    if A%i == B%i == 0:
        c += 1
    if c == K:
        break
    i -= 1
print(i)

Buggy submission (verdict: Runtime Error):
A,B,K = [int(_) for _ in input().split]
M = A*B
print(M * K)
Problem p03260 (python)

Fixed submission:
# -*- coding: utf-8 -*-
 
tmp = input()
a=[int(x) for x in tmp.split()]

if a[0]*a[1] % 2 == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import fractions
 
N,X = map(int, input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
y=[]
 
i=0
while i < n:
    y.append(x[i+1]-x[i])
    i +=1
y.sort()
 
y=list(set(y))
m=len(y)
z=y[0]
i=0
while i < m:
    z=fractions.gcd(z,y[i])
    i+=1
 
print(z)
Problem p03262 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import fractions
import numpy as np
 
N,X = map(int, input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
 
x=np.array(x)
 
y=x[1:]-x[:-1]
 
y.sort()
y=list(set(y))
z=y[0]
m=len(y)
i=0
while i < m:
    z=fractions.gcd(z,y[i])
    i+=1
 
print(z)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import fractions
 
N,X = map(int, input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
y=[]
 
i=0
while i < n:
    y.append(x[i+1]-x[i])
    i +=1
y.sort()
 
y=list(set(y))
m=len(y)
z=y[0]
i=0
while i < m:
    z=fractions.gcd(z,y[i])
    i+=1
 
print(z)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import fraction
 
tmp=input()
n = int(tmp.split(" ")[0])
X = int(tmp.split(" ")[1])
tmp=input()
i=int(0)
x=[]
for i in range(n):
    x.append(int(tmp.split(" ")[i]))
x.append(X)
x.sort()
y=[]

i=0
while i < n:
    y.append(x[i+1]-x[i])
    i +=1
y.sort()

z=y[0]
i=0
while i < n:
    z=fraction.gcd(z,y[i])
    i+=1

print(z)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
 
tmp=input()
n = int(tmp.split(" ")[0])
X = int(tmp.split(" ")[1])
tmp=input()
i=int(0)
x=[]
for i in range(n):
    x.append(int(tmp.split(" ")[i]))
x.append(X)
x.sort()
y=[]

i=0
while i < n:
    y.append(x[i+1]-x[i])
    i +=1
y.sort()

z=y[0]
i=0
while i < n:
    z=math.gcd(z,y[i])
    i+=1

print(z)
Problem p03260 (python)

Fixed submission:
args = input().split()
if ( int(args[0]) * int(args[1]) ) % 2 == 0:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
count, init = tuple(map(int, input().split(" ")))
Xs = [init] + list(map(int, input().split(" ")))
l = [abs(Xs[i]-Xs[i+1]) for i in range(count)]
for i in range(2, min(l)+1)[::-1]:
    if max(map(lambda x: x%i, l)) == 0:
        print(i)
        exit(0)
print(1)

Buggy submission (verdict: Runtime Error):
args = input().split(" ")
if args[0]*args[1]%2 == 0:
  print("No")
else:
  print("Yes")
Problem p03262 (python)

Fixed submission:
from functools import reduce
import numpy as np

def gcd(a, b):
    if b > 0:
        return gcd(b, a%b)
    else:
        return a

def gcd_list(arg_list):
    return reduce(gcd, arg_list)

N, X = tuple(map(int, input().split(" ")))
Xs = [X] + list(map(int, input().split(" ")))
Xs = map(abs, np.diff(Xs))
r = gcd_list(Xs)
print(r)

Buggy submission (verdict: Runtime Error):
from functools import *
N, X = list(map(int, input().split(" ")))
xs = list(map(int, input().split(" ")))
xs = list(map(lambda x: X-x if X>x else x-X, xs))
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b) 
r = reduce(gcd, d)
print(r)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd(arg_list):
    return reduce(math.gcd, arg_list)

N, X = tuple(map(int, input().split(" ")))
Xs = list(map(int, input().split(" ")))
r = gcd(Xs)
print(r)
Problem p03128 (python)

Fixed submission:
M = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

max_vs = [''] * 10001
n, m = [int(v) for v in input().split()]
a = [int(v) for v in input().split()]
for i in range(1, n + 1):
        for v in a:
                if M[v] > i:
                        continue
                elif M[v] == i:
                        if max_vs[i] == '' or int(max_vs[i]) < v:
                                max_vs[i] = str(v)
                else:
                        if max_vs[i - M[v]] != '':
                                if (max_vs[i] == '') or (len(max_vs[i]) < len(str(v) + max_vs[i - M[v]])) or (len(max_vs[i]) == len(str(v) + max_vs[i - M[v]]) and max_vs[i] < str(v) + max_vs[i - M[v]]):
                                        max_vs[i] = str(v) + max_vs[i - M[v]]
print(max_vs[n])

Buggy submission (verdict: Runtime Error):
M = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

def max_int(n, a, prefix):
        if n == 0:
                return int(prefix)
        ma = -1
        for v in a:
                if n < M[v]:
                        continue
                ma = max(ma, max_int(n - M[v], a, prefix + str(v)))
        return ma


n, m = [int(v) for v in input().split()]
a = [int(v) for v in input().split()]
print(max_int(n, a, ''))
Problem p03147 (python)

Fixed submission:
def calc_watering_num(h, offset, left, right):
        if left > right:
                return 0
        min_h = None
        min_h_indices = []
        for i in range(left, right + 1):
                if min_h is None or min_h > h[i] - offset:
                        min_h = h[i] - offset
                        min_h_indices = [i]
                elif min_h == h[i] - offset:
                        min_h_indices.append(i)
        if len(min_h_indices) == right - left + 1:
                return min_h
        num = min_h
        prev = left
        for i in min_h_indices:
                num += calc_watering_num(h, offset + min_h, prev, i - 1)
                prev = i + 1
        num += calc_watering_num(h, offset + min_h, prev, right)
        return num


input()
h = [int(v) for v in input().split()]
print(calc_watering_num(h, 0, 0, len(h) - 1))

Buggy submission (verdict: Runtime Error):
"main.py" 5L, 116C written
def calc_watering_num(h, offset, left, right):
        if left > right:
                return 0
        min_h = None
        min_h_indices = []
        for i in range(left, right + 1):
                if min_h is None or min_h > h[i] - offset:
                        min_h = h[i] - offset
                        min_h_indices = [i]
                elif min_h == h[i] - offset:
                        min_h_indices.append(i)
        if len(min_h_indices) == right - left + 1:
                return min_h
        num = min_h
        prev = left
        for i in min_h_indices:
                num += calc_watering_num(h, offset + min_h, prev, i - 1)
                prev = i + 1
        num += calc_watering_num(h, offset + min_h, prev, right)
        return num


input()
h = [int(v) for v in input().split()]
print(calc_watering_num(h, 0, 0, len(h) - 1))
Problem p03244 (python)

Fixed submission:
def get_second(a):
	if len(a) == 1:
		return 0
	else:
		return a[1][0]

n = int(input())
a = [int(v) for v in input().split()]
nums = [{}, {}]
for i, v in enumerate(a):
	if v in nums[i % 2]:
		nums[i % 2][v] += 1
	else:
		nums[i % 2][v] = 1
evens = sorted([(v, k) for k, v in nums[0].items()], reverse=True)
odds = sorted([(v, k) for k, v in nums[1].items()], reverse=True)
if evens[0][1] != odds[0][1]:
	print(n - evens[0][0] - odds[0][0])
else:
	print(n - max(evens[0][0] + get_second(odds), get_second(evens) + odds[0][0]))

Buggy submission (verdict: Runtime Error):
def get_second(a):
	if len(a) == 1:
		return 0
	else:
		a[1][0]

n = int(input())
a = [int(v) for v in input().split()]
nums = [{}, {}]
for i, v in enumerate(a):
	if v in nums[i % 2]:
		nums[i % 2][v] += 1
	else:
		nums[i % 2][v] = 1
evens = sorted([(v, k) for k, v in nums[0].items()], reverse=True)
odds = sorted([(v, k) for k, v in nums[1].items()], reverse=True)
if evens[0][1] != odds[0][1]:
	print(n - evens[0][0] - odds[0][0])
else:
	print(n - max(evens[0][0] + get_second(odds), get_second(evens) + odds[0][0]))
Problem p03106 (python)

Fixed submission:
a,b,k = map(int, input().split())
 
q = []
 
for i in range(1,min(a,b)+1):
  if a % i == 0 and b % i == 0:
    q.append(i)
 
print(q[-k])

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

q = [1]

for i in range(2,50):
  if a % i == 0 and b % i == 0:
    q.append(i)

print(q[k - 1])
Problem p03294 (python)

Fixed submission:
from functools import reduce
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)


def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(nums):
    return reduce(lcm_base, nums, 1)

n, a = input(), list(map(int, input().split()))
l = lcm(a)
sum = 0
for aa in a:
    sum += (l-1) % aa
print(sum)

Buggy submission (verdict: Runtime Error):
import fraction
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fraction.gcd(x, y)

def lcm(nums):
    return reduce(lcm_base, nums, 1)

n, a = input(), list(map(int, input().split()))
l = lcm(a)
sum = 0
for aa in a:
    sum += (l-1) % aa
print(sum)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(nums):
    return reduce(lcm_base, nums, 1)

n, a = input(), list(map(int, input().split()))
l = lcm(a)
sum = 0
for aa in a:
    sum += (l-1) % aa
print(sum)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(nums):
    return reduce(lcm_base, nums, 1)

n, a = input(), list(map(int, input().split()))
l = lcm(a)
sum = 0
for aa in a:
    sum += (l-1) % aa
print(sum)
Problem p03423 (python)

Fixed submission:
print(int(int(input())/3))

Buggy submission (verdict: Runtime Error):
print(input()/3)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
print("Even" if a * b % 2 == 0 else "Odd")

Buggy submission (verdict: Runtime Error):
N = int(input())
txys = [list(map(int, input().split())) for _ in range(N) ]
txys.insert(0, [0, 0, 0])
 
for i in range(N):
    dt = txys[i+1][0] - txys[i][0]
    dist = abs(txys[i][1] - txys[i+1][1]) + abs(txys[i][2] - txys[i+1][2])
    if dt % 2 != dist % 2 or dist > dt:
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
print("Even" if int(input()) * int(input()) % 2 == 0 else "odd")
Problem p03472 (python)

Fixed submission:
N, H = list(map(int, input().split()))
maxA = 0
n = 0
b = []
for _ in range(N):
    ta, tb = list(map(int, input().split()))
    maxA = max(maxA, ta)
    b.append(tb)

b = list(filter(lambda x: x > maxA, b))
b.sort()

while H > 0 and b:
    H -= b.pop()
    n += 1

print(n + max(H-1, -1) // maxA + 1 )

Buggy submission (verdict: Runtime Error):
import math
N, H = list(map(int, input().split()))
maxA = 0
n = 0
b = []
for _ in range(N):
    ta, tb = list(map(int, input().split()))
    maxA = max(maxA, ta)
    b.append(tb)

b = list(filter(lambda x: x > maxA, b))
b.sort()

while H > 0 and b:
    H -= b.pop()
    n += 1

print(n + max(H-1, -1) // a + 1 )

Buggy submission (verdict: Runtime Error):
import math
N, H = list(map(int, input().split()))
a = []
b = []
for _ in range(N):
    ta, tb = list(map(int, input().split()))
    a.append(ta)
    b.append(tb)

b = list(filter(lambda x: x > max(a), b))
b.sort()
slashNum = math.ceil( (H - sum(b)) / max(a) )

dmg = slashNum * max(a)
for i in range(N):
    dmg += b[-i]
    if dmg >= H:
        print(slashNum + i + 1)
        exit()

Buggy submission (verdict: Runtime Error):
import math
N, H = list(map(int, input().split()))
a = []
b = []
for _ in range(N):
    ta, tb = list(map(int, input().split()))
    a.append(ta)
    b.append(tb)

b = list(filter(lambda x: x > max(a), b))
b.sort()
b.reverse()
slashNum = math.ceil( (H - sum(b)) / max(a) )

dmg = slashNum * max(a)
for i in range(N):
    dmg += b[i]
    if dmg >= H:
        print(slashNum + i + 1)
        exit()

Buggy submission (verdict: Runtime Error):
import math
N, H = list(map(int, input().split()))
a = []
b = []
for _ in range(N):
    ta, tb = list(map(int, input().split()))
    a.append(ta)
    b.append(tb)

b = list(filter(lambda x: x > max(a), b))
b.sort()
b.reverse()
slashNum = math.ceil( (H - sum(b)) / max(a) )

dmg = slashNum * max(a)
for i in range(N):
    dmg += b[i]
    if dmg >= H:
        print(slashNum + i + 1)
        break