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

Fixed submission:
n,X = map(int,input().split())
x =list(map(int,input().split()))
x.append(X)
x.sort()
a = []
for i in range(n):
  a.append(x[i+1]-x[i])
  
h = min(a)
gcd = 1
for i in range(h,0,-1):
  if h%i == 0:
    if all(a[j]%i == 0 for j in range(n)):
      gcd = i
      break
      
print(gcd)

Buggy submission (verdict: Runtime Error):
n,X = map(int,input().split())
x =list(map(int,input().split()))
x.append(X)
x.sort()
a = []
for i in range(n):
  a.append(x[i+1]-x[i])
  
h = min(a)
gcd = 1
for i in range(h,0,-1):
  if h%i == 0:
    if all(a[j]%i == 0 for j in range(n)):
      gcd = i
      break
      
print(gcd)
    

    
    
    


    gcd = i
    break
    
    
print(gcd)

Buggy submission (verdict: Runtime Error):
n,X = map(int,input().split())
x =list(map(int,input().split()))
x.append(X)
x.sort()
a = []
for i in range(n):
  a.append(x[i+1]-x[i])
  
g = []
h = min(a)
gcd = 1
for i in range(h,0,-1):
  if h%i == 0:
    if all(a[j]%i == 0 for j in range(n)):
      gcd = i
      break
      
print(gcd)
    

    
    
    


    gcd = i
    break
    
    
print(gcd)

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

n,X = map(int,input().split())
x =list(map(int,input().split()))
x.append(X)
x.sort()
a = []*n
for i in range(n):
  a[i] = x[i+1]-x[i]
  
g = gcd(*a)
print(g)
Problem p03273 (python)

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

row = [False]*h
column = [False]*w

for i in range(h):
  for j in range(w):
    if a[i][j] == "#":
      row[i] = True
      column[j] = True

for i in range(h):
  if row[i]:
    for j in range(w):
      if column[j]:
        print(a[i][j],end = "")
    print()

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

row = [False]*h
column = [False]*w

for i in range(h):
  for j in range(w):
    if a[i][j] = "#":
      row[i] = True
      column[j] = True

for i in range(h):
  if row[i]:
    for j in range(w):
      if column[j]:
        print(a[i][j],end = "")
    print()

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

row = [False]*h
column = [False]*w

for i in range(h):
  for j in range(w):
    if a[i][j] = "#":
      row[i] = True
      column[j] = True

for i in range(h):
  if row[i]:
    for j in range(w):
      if column[j]:
        print("a[i][j]",end = "")
    print()
Problem p03285 (python)

Fixed submission:
n = int(input())
a = [1,2,3,5,6,9,10,13,17]
if n in a:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [1,2,3,5,6,9,10,13,17]
if n in a:
  print(No)
else:
  print(Yes)
Problem p03289 (python)

Fixed submission:
s = input()
check = 0
if s[0] == "A":
  if s[2:len(s)-1].count("C") == 1:
    if s[1].lower() == s[1] and s[len(s)-1].lower() == s[len(s)-1]:
      t = s.replace("C","")
      if t[1:len(s)].lower() == t[1:len(s)]:
        check = 1
        
if check == 0:
  print("WA")
else:
  print("AC")

Buggy submission (verdict: Runtime Error):
s = input()
check = 0
if s[0] == "A":
  if s[2:len(s)-1].count("C") == 1:
    if s[1].lower() == s[1] and s[len(s)-1].lower() == s[len(s)-1]:
      s.lstrip("C")
      if s[1:len(s)].lower() == s[1:len(s)]:
        check = 1
        
if check = 0:
  print("WA")
else:
  print("AC")
Problem p03293 (python)

Fixed submission:
a = str(input())
b = str(input())
check = 0
for i in range(len(a)):
  if a == b:
    check = 1
    break
  else:
    a = a[len(a)-1] + a[0:len(a)-1]
    
if check == 0:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a = str(input())
b = str(input())
check = 0
for i in range(len(a)):
  if a == b:
    check = 1
    break
  else:
    a = a[len(a)] + a[0:len(a)]
    
if check == 0:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a = str(input())
b = str(input())
check = 0
for i in range(len(a)):
  if a = b:
    check = 1
    break
  else:
    a = a[len(a)] + a[0:len(a)]
    
if check = 0:
  print("No")
else:
  print("Yes")
Problem p03294 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
print(sum(a)-n)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split())
print(sum(a)-n)
Problem p03309 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(a[i]-i-1 for i in range(n))
b.sort()

def sadness(x,y):
  s = 0
  for i in range(len(y)):
    s += abs(y[i]-x)
  return s

if n%2 == 0:
  print(sadness(b[int(n/2)],b))
else:
  print(sadness(b[int((n-1)/2)],b))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = list(a[i]-i-1 for i in range(n))
b.sort()

def sadness(x,y):
  s = 0
  for i in range(len(y)):
    s += abs(y[i]-x)
  return s

if n%2 == 0:
  print(sadness(a[n/2],b))
else:
  print(sadness(a[(n-1)/2],b))
Problem p03355 (python)

Fixed submission:
s = str(input())
k = int(input())
sub = []
c = 5
if len(s)  < 5:
  c = len(s)
for i in range(c):
  for j in range(len(s)-i):
    sub.append(s[j:j+i+1])

sub = list(set(sub))
sub.sort()
print(sub[k-1])

Buggy submission (verdict: Runtime Error):
s = str(input())
k = int(input())
sub = []
c = 5
if len(s)  < 5:
  c = len(s)
for i in range(c):
  for j in range(len(s)-i-1):
    sub.append(s[j:j+i+1])

sub = list(set(sub))
sub.sort()
print(sub[k-1])
Problem p03361 (python)

Fixed submission:
h,w = map(int,input().split())
t = "."*(w+2)
b = [t]
for i in range(h):
  s = str(input())
  s = "."+ s + "."
  b.append(s)
b.append(t)
for i in range(1,h+1):
  for j in range(1,w+1):
    if b[i][j] == "#":
      if all([b[i-1][j]==".",b[i+1][j]==".",b[i][j-1]==".",b[i][j+1]=="."]):
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
t = "."*(w+2)
b = [t]
for i in range(h):
  s = str(input())
  s = "."+ s + "."
  b.append(s)
b.append(t)
for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j] == "#":
      if all([s[i-1][j]==".",s[i+1][j]==".",s[i][j-1]==".",s[i][j+1]=="."]):
        print("No")
        exit()
print("Yes")
Problem p03371 (python)

Fixed submission:
a,b,c,x,y = map(int,input().split())
if 2*c-a-b >= 0:
  print(a*x+b*y)
else:
  s = 0
  if x >= y:
    s += 2*c*y
    x -= y
    s += min(2*c,a)*x
    print(s)
  else:
    s += 2*c*x
    y -= x
    s += min(2*c,b)*y
    print(s)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int,input().split())
if 2*c-a-b >= 0:
  print(a*x+b*y)
else:
  s = 0
  if x => y:
    s += 2*c*x
    x -= y
    s += min(2*c,a)*x
    print(s)
  else:
    s += 2*c*y
    y -= x
    s += min(2*c,b)*y
    print(s)
Problem p03379 (python)

Fixed submission:
n = int(input())
x = list(map(int,input().split()))
y = sorted(x)
a = y[n//2-1]
b = y[n//2]
for i in range(n):
  if x[i] <= a:
    print(b)
  else:
    print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
y = x.sorted()
a = y[n//2-1]
b = y[n//2]
for i in range(n):
  if x[i] <= a:
    print(b)
  else:
    print(a)
Problem p03457 (python)

Fixed submission:
n = int(input())
bx = 0
by = 0
bt = 0
def p(t,x,y):
  if abs(x)+abs(y) > t:
    return True
  elif (t-abs(x)-abs(y))%2 == 1:
    return True
  else:
    return False
for _ in range(n):
  at,ax,ay = map(int,input().split())
  if p(at-bt,bx-ax,by-ay):
    print("No")
    exit()
  bx = ax
  by = ay
  bt = at
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
bx = 0
by = 0
bt = 0
def p(t,x,y):
  if abs(x)+abs(y) > t:
    return True
  elif (t-abs(x)-abs(y))%2 == 1:
    return True
  else:
    return False
for _ in range(n):
  at,ax,ay = map(int,input().split())
  if p(at-bt,bx-ax,by-ay):
    print(p(t,bx-ax,by-ay))
    print("No")
    exit()
  bx = ax
  by = ay
  bt = at
print("Yes")
Problem p02606 (python)

Fixed submission:
L,R,d = map(int,input().split())
ans = 0
for i in range(L,R+1):
  if i % d == 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
L.R,d = map(int,input().split())
ans = 0
for i in range(L,R+1):
  if i % d == 0:
    ans += 1
print(ans)
Problem p02646 (python)

Fixed submission:
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if abs(B-A)+(W-V)*T > 0:
  print("NO")
else:
  print("YES")

Buggy submission (verdict: Runtime Error):
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if B-A+ > (W-V)*T:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A,V = map(int,input().split())
B,W = map(int,input().split())
T
if B-A+(W-V)*T > 0:
  print("NO")
else:
  print("YES")
Problem p02664 (python)

Fixed submission:
print(input().replace("?","D"))

Buggy submission (verdict: Runtime Error):
T = input()
print(T.replase("?","D"))
Problem p02675 (python)

Fixed submission:
A = input()
if A[-1] == "3":
    print("bon")
elif A[-1] == "0" or A[-1] == "1" or A[-1] == "6" or A[-1] == "8":
    print("pon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
import math
a, b, h, m = map(int, input().split())
x = 30 * h + (m * 0.5) % 360
y = m * 6
sa = abs(x - y)
print(x,y,sa)
if a > b:
    c = b
    b = a
    a = c
t = (math.sin(math.radians(sa))) * b
f = math.sqrt(b ** 2 - t ** 2)
if sa >= 180:
    a = -a
print(math.sqrt((f - a) ** 2 + t ** 2))
Problem p02732 (python)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
B = Counter(A)
C = {key:(B[key]*(B[key]-1)//2) for key in B}
ans = sum(C.values())
#print(C,ans)
#print(C[3])
for i in A:
    if C[i] < 1:
        print(ans)
    else:
        print(ans - C[i] + (B[i]-1)*(B[i]-2)//2)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
B = Counter(A)
C = {key:(B[key]*(B[key]-1)//2) for key in B}
ans = sum(B.values())
for i in A:
    if C[i] < 2:
        print(ans)
    else:
        ans = ans - C[i] +(B[key-1]*(B[key]-2)//2)
        print(ans)
Problem p02743 (python)

Fixed submission:
from decimal import Decimal
a,b,c = map(float,input().split())
print("Yes" if Decimal(a)**Decimal(0.5)+Decimal(b)**Decimal(0.5) < Decimal(c)**Decimal(0.5) else "No")

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(float,input().split())
print("Yes" if a**0.5+b**0.5 < c**0.5 and math.isclose(a**0.5+b**0.5 , c**0.5)==False else "No")
Problem p02747 (python)

Fixed submission:
S = input()
print("Yes" if S.count("hi")*2==len(S) else "No")

Buggy submission (verdict: Runtime Error):
S = input()
if S[:2]=="hi" and S[2] != "i":
    print("Yes")
else:
    print("No")
Problem p02802 (python)

Fixed submission:
N, M = map(int, input().split())
WA = [0] * N
AC = [0] * N
for i in range(M):
    p,s = input().split()
    p = int(p)
    if AC[p-1] == 0:
        if s == "AC":
            AC[p-1] = 1
        else:
            WA[p-1] += 1
wa = 0
for j in range(N):
    if AC[j] == 1:
        wa += WA[j]
print(sum(AC),wa)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
WA = [0] * N
AC = [0] * N
for i in range(M):
    p,s = input().split()
    p = int(p)
    if AC[p-1] == 0:
        if s == "AC":
            AC[p-1] = 1
        else:
            WA[p-1] += 1
wa = 0
for j in range(M):
    if AC[j] == 1:
        wa += WA[j]
print(sum(AC),wa)
Problem p02818 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
if A+B <= K:
print(0,0)
elif A >= K:
  print(A-K,B)
else:
  print(0,B-K+A)
Problem p02885 (python)

Fixed submission:
A,B = map(int,input().split())
if A-2*B < 0:
  print(0)
else:
  print(A-2*B)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
if A-2*B < 0:
  print(0)
else:
  print(A-2*b)
Problem p02923 (python)

Fixed submission:
import sys
N = int(input())
A = list(map(int, input().split()))
B = []
C = 0
try:
    for i in range(N):
        if A[i] >= A[i + 1]:
            None
        else:
            B.append(A[C:i+1])
            C = i+1
except:
    try:
        if A[-2] >= A[-1]:
            B.append(A[C:])
        else:
            B.append(A[C:-1])
    except:
        print(0)
        sys.exit()
X = [len(B[j]) for j in range(len(B))]
print(max(X)-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = []
C = 0
try:
    for i in range(N):
        if A[i] >= A[i + 1]:
            None
        else:
            B.append(A[C:i+1])
            C = i+1
except:
    if A[-2] >= A[-1]:
        B.append(A[C:])
    else:
        B.append(A[C:-1])
X = [len(B[j]) for j in range(len(B))]
print(max(X)-1)
Problem p02947 (python)

Fixed submission:
import collections
import math

N = int(input())
b =[]
for i in range(N):
    a = input()
    b.append([j for j in a])
    b[i].sort()
a = [''.join(j) for j in b]
b = [k for k in collections.Counter(a).values()]
c = 0
for x in range(len(b)):
    if b[x] > 1:
        c += math.factorial(b[x]) // (math.factorial(b[x] - 2) * math.factorial(2))
    else:
        None
print(c)

Buggy submission (verdict: Runtime Error):
import collections
from scipy.special import comb

N = int(input())
b =[]
for i in range(N):
    a = input()
    b.append([j for j in a])
    b[i].sort()
a = [''.join(j) for j in b]
b = [k for k in collections.Counter(a).values()]
c = 0
for x in range(len(b)):
    if b[x] > 1:
        c += comb(b[x], 2, exact=True)
    else:
        None
print(c)
Problem p02971 (python)

Fixed submission:
import numpy as np
N = int(input())
num_list = [int(input()) for i in range(N)]
a = max(num_list)
if num_list.count(a) > 1:
  for j in range(N):
    print(a)
else:
  b = np.sort(num_list)
  c = b[-2]
  for k in range(int(num_list.index(a))):
    print(a)
  print(c)
  for l in range(N-int(num_list.index(a))-1):
    print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
B = sorted(A,reverse=True)
max1 = B[0]
max2 = B[1]
print(max1,max2)
for i in N:
    if A[i] == max1:
        print(max2)
    else:
        print(max1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
B = sorted(A,reverse=True)
max1 = B[0]
max2 = B[1]
print(max1,max2)
for i in A:
    if A[i] == max1:
        print(max2)
    else:
        print(max1)
Problem p02981 (python)

Fixed submission:
N,A,B = map(int,input().split())
if N*A > B:
  print(B)
else:
  print(A*N)

Buggy submission (verdict: Runtime Error):
l,r = map(int,input().split())
b = sorted([i%2019 for i in range(l,min(r+1,l+2019))])
print(b[0]*b[1])
Problem p02995 (python)

Fixed submission:
from fractions import gcd
A,B,C,D = map(int,input().split())
E = C*D//gcd(C,D)
ans = 0
ans += B-B//C-B//D+B//E
ans -= A-1-(A-1)//C-(A-1)//D+(A-1)//E
print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd
A,B,C,D = map(int,input().split())
ans = 0
N = 1
E = C*D//gcd(C,D)
ans += B-B//C-B//D+B//E
ans -= A-A//C-A//D+A//E
print(ans)
Problem p03014 (python)

Fixed submission:
import numpy as np
H,W = map(int,input().split())
S = np.array([list(input()) for _ in range(H)])
S = np.where(S=='.',1,0)


L = np.zeros((H,W),dtype=np.int)
R = np.zeros((H,W),dtype=np.int)
U = np.zeros((H,W),dtype=np.int)
D = np.zeros((H,W),dtype=np.int)

for i in range(W):
    L[:,i] = (L[:,i-1]+1)*S[:,i]
    R[:,-i-1] = (R[:,-i]+1)*S[:,-i-1]
for j in range(H):
    U[j,:] = (U[j-1,:]+1)*S[j,:]
    D[-j-1,:] = (D[-j,:]+1)*S[-j-1,:]

print(np.max(L+R+U+D)-3)

Buggy submission (verdict: Runtime Error):
import numpy as np
H,W = map(int,input().split())
S = [list(input()) for _ in range(H)]
print(S)
print()
L = np.zeros((H,W),dtype=np.int)
R = np.zeros((H,W),dtype=np.int)
U = np.zeros((H,W),dtype=np.int)
D = np.zeros((H,W),dtype=np.int)
print(L)
print(L[2][1])
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            L[i][j] = 0
        else:
            L[i][j] = L[i][j-1]+1
        if S[-i-1][-j-1] == "#":
            R[-i-1][-j-1] = 0
        else:
            R[-i-1][-j-1] = R[-i-1][-j]+1

for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            U[i][j] = 0
        else:
            U[i][j] = U[i-1][j]+1
        if S[-i-1][-j-1] == "#":
            D[-i-1][-j-1] = 0
        else:
            D[-i-1][-j-1] = D[-i][-j-1]+1
print(np.max(L+R+U+D)-3)
Problem p03030 (python)

Fixed submission:
N = int(input())
A = []
for i in range(N):
    S, P = map(str, input().split())
    P = int(P)
    A.append([S, -P])
S = sorted(A)
for j in S:
    print(A.index(j) + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
    S, P = map(str, input().split())
    P = int(p)
    A.append([S, -P])
A.sort()
for i in A:
    print(A.index(i)+1)
Problem p03035 (python)

Fixed submission:
A,B = map(int,input().split())
if A >= 13:
  print(B)
elif 6 <= A <= 12:
  print(B//2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A,B =map(int,input().split())
if A >= 13:
  print(B)
elif A >= 6:
  print(B//2)
else:
print(0)
Problem p03047 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
print(N - K + 1)
Problem p03080 (python)

Fixed submission:
N = int(input())
S = input()
print("Yes" if N/2 < S.count("R") else "No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
print("Yes" if N/2 < S.count(R) else "No")
Problem p03102 (python)

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

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

Fixed submission:
a = list(map(int,input().split()))
if a[1]//a[0] == 0:
  print(0)
elif a[1]//a[0]> a[2]:
  print(a[2])
else:
  print(a[1]//a[0])

Buggy submission (verdict: Runtime Error):
a = list(map(int.input().split()))
if a[1]//a[0] == 0:
  print(0)
elif a[1]//a[0]> a[2]:
  print(a[2])
else:
  print(a[1]//a[0])

Buggy submission (verdict: Runtime Error):
A,B,C = map(int.input().split())
if B//A == 0:
  print(0)
elif B//A > C:
  print(C)
else:
  print(B//A)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int.input().split())
if B//A < C:
  print(B//A)
else:
  print(C)
Problem p03109 (python)

Fixed submission:
a = list(map(int,input().split("/")))
if a[1] > 4:
  print("TBD")
else:
  print("Heisei")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split(/)))
if a[1] > 4:
  print("TBD")
else:
  print("Heisei")
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
if N % 2 == 1:
  print("Hello World")
else:
  a,b = map(int,input().split())
  print(a*b)

Buggy submission (verdict: Runtime Error):
N = int(input())
b = int(input())
c = int(input())
if N == 1:
  print("Hello World")
elif N == ":
  print(b+c)

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

Fixed submission:
N,T = map(int,input().split())
c = []
t = []
for i in range(N):
  a,b = map(int,input().split())
  c.append(a)
  t.append(b)
result = []
for j in range(N):
  if T >= t[j]:
    result.append(c[j])
  else:
    None
print(min(result) if len(result) > 0 else "TLE")

Buggy submission (verdict: Runtime Error):
N,T = map(int,input().split())
c = []
t = []
for i in range(N):
  a,b = map(int,input().split())
  c.append(a)
  t.append(b)
result = []
for j in range(N):
  if T >= t[j]:
    result.append(c[j])
  else:
    None
print(min(result))

Buggy submission (verdict: Runtime Error):
N,T = map(int,input().split())
c = []
t = []
for i in range(N):
  a,b = map(int,input(),split())
  c.append(a)
  t.append(b)
result = []
for j in range(N):
  if T >= t[j]:
    result.append(c[j])
  else:
    None
print(min(result))
Problem p03262 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
N,X = map(int,input().split())
A = list(map(int,input().split()))
B = [abs(X-i) for i in A]
ans = B[0]
for j in B:
    ans = gcd(ans, j)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
N,X = map(int,input().split())
A = list(map(int,input().split()))
B = [abs(X-i) for i in A]
ans = B[0]
for j in B:
    ans = math.gcd(ans, j)
print(ans)
Problem p03264 (python)

Fixed submission:
N = int(input())
print((N//2)**2 if N%2==0 else (1+N//2)*(N//2))

Buggy submission (verdict: Runtime Error):
N = int(input())
print((N?/2)**2 if N%2==0 else (1+N//2)*(N//2))
Problem p03282 (python)

Fixed submission:
import sys
S = input()
K = int(input())
result = [0,""]
for i in S:
  if i != "1":
    result[1] = i
    break
  else:
    result[0] += 1
print(1 if K<=result[0] else result[1] )

Buggy submission (verdict: Runtime Error):
import sys
S = input()
K = int(input())
result = [0,0]
for i in len(s):
  if S[i] != 1:
    result[0] = i+1
    result[1] = S[i]
print(1 if K<result[0] else result[1] )
Problem p03292 (python)

Fixed submission:
a,b,c = map(int,input().split())
A = [a,b,c]
A.sort()
print(A[2]-A[0])

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
A = [a,b,c]
A.sort()
print(a[2]-a[0])
Problem p03296 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N-1):
  if A[i] == A[i+1]:
    A[i+1] = -1
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
result = 0
for i in range(N-1):
  if A[i] == A[i+1]:
    result += 1
    if A[i+2]!=A[i+1] :
      A[i+1] = abs(A[i+2]-A[i+1])
    elif A[i+2]==A[i+1] and A[i+1]==1:
      A[i+1] = 2
    else:
      A[i+1] = 1
print(result)
Problem p03325 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
result = 0
for i in A:
  B = i
  while B % 2 == 0:
    result += 1
    B = B // 2
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
result = 0
for i in A:
  B = A
  while B % 2 == 0:
    result += 1
    B = B // 2
print(result)
Problem p03331 (python)

Fixed submission:
N = int(input())
A = [i for i in str(N)]
result = 0
for j in range(len(A)):
  result += int(A[j])
if result == 1 and A[0] == "1":
  print(10)
else:
  print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [i for i in str(N)]
result = 0
for j in range(len(A)):
  result += A[j]
if result == 0 and A[0] == 1:
  print(10)
else:
  print(result)
Problem p03351 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input(),split())
if abs(a-b) <= d and abs(b-c) <= d:
  print("Yes")
else:
  print("No")
Problem p03360 (python)

Fixed submission:
num = list(map(int,input().split()))
K = int(input())
A = max(num)
num.sort()
for i in range(K):
  A *= 2
print(sum(num)-num[-1]+A)

Buggy submission (verdict: Runtime Error):
num = list(map(int,input().split()))
K = int(input())
A = max(num)
A.sort()
for i in range(K):
  A *= 2
print(sum(num)-num[-1]+A)
Problem p03386 (python)

Fixed submission:
A,B,K = map(int,input().split())
ans = []
for i in range(A,A+K):
  if i <= B:
    ans.append(i)
#print(ans)
for j in range(B,B-K,-1):
  #print("j",j)
  if j >= A+K:
    ans.append(j)
ans.sort()
for k in ans:
  print(k)

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
ans = []
for i in range(A,A+K+1):
  if i <= B:
    ans.append(i)
for j in range(B,B-K,-1):
  if A.count(j) == 0 and j >= A:
    ans.append(j)
ans.sort()
for k in ans:
  print(k)