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

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

count = 0

for n in range(10000):
    za = n*0.08
    zb = n*0.1
    count += 1
    if A == math.floor(za) and B == math.floor(zb):
        print(n)
        break


if count == 10000:
    print(-1)

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

Amin = A/0.08
Amax = (A+1)/0.08
Bmin = B/0.1
Bmax = (B+1)/0.1


if Amax <= Bmin or Amin > Bmax:
    kai = -1
if Bmin <= Amin and Bmax > Amin:
    kai = Amin
if Amin <= Bmin and Bmax < Amin:
    kai = Bmin

print(kai)

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

one = A/0.08
two = (A+1)/0.08
three = B/0.1
four = (B+1)/0.1


if two <= three or one > four:
    kai = -1
if three <= one and four > one:
    kai = one
if one <= three and four < two:
    kai = three

print(kai)

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

one = A/0.08
two = (A+1)/0.08
three = B/0.1
four = (B+1)/0.1


if two <= three or one >= four:
    kai = -1
if three <= one and four > one:
    kai = one
if one <= three and four <= two:
    kai = three

print(kai)

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

one = A/0.08
two = (A+1)/0.08
three = B/0.1
four = (B+1)/0.1

print(one, two, three, four)


if two < three or one > four:
    kai = -1
if three <= one and four >= one:
    kai = one
if one < three and four <= two:
    kai = three

print(kai)
Problem p02717 (python)

Fixed submission:
X,Y,Z=map(int, input().split()) 
X,Y = Y,X
X,Z = Z,X
print(X,Y,Z)

Buggy submission (verdict: Runtime Error):
N,K=map(int, input().split()) 
min = abs(N-K)
if N < K:
    if min < abs(min-K):
        print(min)
    else:
        print(abs(min-K))
else: 
    while min >= abs(min-K):
        min = abs(min-K)
        if min < K:
            if min < abs(min-K):
                print(min)
                break
            else:
                print(abs(min-K))
                break
    else :
        print(min)
Problem p02621 (python)

Fixed submission:
a=int(input())
print((a)+(a*a)+(a**3))

Buggy submission (verdict: Runtime Error):
n=int(input())
print((a)+(a*a)+(a**3))
Problem p02687 (python)

Fixed submission:
s=str(input())
if(s=="ABC"):
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
s=str(input())
if(s=="ABC"):
  print("ARC")
 else:
  print("ABC")
Problem p02921 (python)

Fixed submission:
l1=list(input())
l2=list(input())
w=len(l1)
all=0
for i in range(0,w):
    if (l1[i]==l2[i]):
        all=all+1
print(all)

Buggy submission (verdict: Runtime Error):
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
w=len(l1)
all=0
for i in range(0,w):
    if (l1[i]==l2[i]):
        all=all+1
print(all)
Problem p02957 (python)

Fixed submission:
l=list(map(int,input().rstrip().split()))
a=l[0]
b=l[1]
k=(a+b)/2
g=int(k)
if(k==g):
    print(g)
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
k=(a+b)/2
g=int(k)
if(k==g):
    print(k)
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
k=(a+b)/2
g=(a+b)//2
if(k==g):
    print(k)
else:
    print("IMPOSSIBLE")
Problem p02971 (python)

Fixed submission:
t=int(input())
l=[]
b=0
c=0
for j in range(t):
    a=int(input())
    l.append(a)
    if(a>b):
        b=a
    elif(a>c):
        c=a
for i in l:
    if(i!=b):
        print(b)
    else:
        print(c)

Buggy submission (verdict: Runtime Error):
l=[]
t=int(input())
b=0
c=0
for i in range(t):
    a=int(input())
    if(a>b):
        b=a
    else if(b>a and a>c):
        c=a
    l.append(a)
for i in range(0,t):
    if(l[i]!=b):
        print(b)
    else:
        print(c)

Buggy submission (verdict: Runtime Error):
l=[]
t=int(input())
b=0
c=0
for i in range(t):
    a=int(input())
    if(a>b):
        b=a
    else if(b>a and a>c):
            c=a
    l.append(a)
for i in range(0,t):
    if(l[i]!=b):
        print(b)
    else:
        print(c)
Problem p02576 (python)

Fixed submission:
N,X,T = map(int,input().split())
kaisuu = N//X
if kaisuu*X < N:
    zikan = (kaisuu+1)*T
else:
    zikan = kaisuu*T
print(zikan)

Buggy submission (verdict: Runtime Error):
N,X,T = map(int,input().split())
kaisuu = N//12
if kaisuu*X < N:
    zikan = kaisuu+zikan
else:
    zikan = kaisuu
print(zikan)
Problem p03059 (python)

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

p=time*b
print(p)

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
time=int(int(c)/int(a))
print(int(time*b))

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
time = (c+0.5)/a
print (time*b)
Problem p02613 (python)

Fixed submission:
n = int(input())
    
ac = 0
wa = 0
tle = 0
re = 0
 
for _ in range(n):
  s = input()
  if s == 'AC':
    ac += 1
  elif s == 'WA':
    wa += 1
  elif s == 'TLE':
    tle += 1
  else:
    re += 1
    
print('AC x {}'.format(ac))
print('WA x {}'.format(wa))
print('TLE x {}'.format(tle))
print('RE x {}'.format(re))

Buggy submission (verdict: Runtime Error):
n = int(input())
    
ac = 0
wa = 0
tle = 0
re = 0

for _ in range(n):
  s = input()
  if s = 'AC':
    ac += 1
  elif s == 'WA':
    wa += 1
  elif s == 'TLE':
    tle += 1
  else:
    re += re
    
print('AC x {}'.format(ac))
print('WA x {}'.format(wa))
print('TLE x {}'.format(tle))
print('RE x {}'.format(re))
Problem p02812 (python)

Fixed submission:
n = int(input())
s = input()
 
print(len(s.split('ABC')) - 1)

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

print(len(s.split('ABC')) - 1)
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print(t + s)

Buggy submission (verdict: Runtime Error):
s,t = input()

print(s + t)
Problem p02818 (python)

Fixed submission:
a, b, k = map(int, input().split())
 
if a > k:
  print('{} {}'.format(a - k, b))
elif a + b > k:
  print('0 {}'.format(a + b - k))
else:
  print('0 0')

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

for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
  else:
    beak

print('{} {}'.format(a, b))
Problem p02842 (python)

Fixed submission:
n = int(input())
 
ans = -1
for i in range(1, n+1):
  if int(i  * 1.08) == n:
    ans = i
if ans == -1:
  print(':(')
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
import math
from decimal import Decimal
 
n = int(input())
 
if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(Decimal(str(i)) * Decimal("1.08")+0.000001) == n:
      print(i)
      break
  else:
    print(':(')

Buggy submission (verdict: Runtime Error):
import math
from decimal import Decimal
 
n = int(input())
 
if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(Decimal(str(i)) * Decimal("1.08")) == n:
      print(i)
      break
  else:
    while True:
	  pass

Buggy submission (verdict: Runtime Error):
import math
 
n = int(input())
answers = []

if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(i * 1.08) == n:
      answers.append(i)
  if len(answers) == 0:
    print(':(')
  if len(answers) == 1:
    print(answers[0])
  else:
    print(answers[len(answers) // 2])

Buggy submission (verdict: Runtime Error):
import math
 
n = int(input())
answers = []

if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(i * 1.08) == n:
      answers.append(i)
      break
  else:
    print(':(')
  
  if len(answers) == 1:
    print(answers[0])
  else:
    print(answers[len(answers) // 2])

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

for i in range(0.9*n//1, n):
  if (i * 1.08) // 1 == n:
    print(i)
    break
else:
  print(':(')
Problem p02853 (python)

Fixed submission:
x, y = map(int, input().split())

score = 0

for z in [x, y]:
  if z == 1:
    score += 300000
  elif z == 2:
    score += 200000
  elif z == 3:
    score += 100000

if (x == 1) and (y == 1):
  score += 400000
  
print(score)

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

length = 0
lengths = []
for a in aaa:
  length += a
  lengths.append(length)
  
diff = 200000 * 2020202020
for l in lengths:
  if abs(l - (length - l)) < diff:
    diff = abs(l - (length - l))
  else:
    break
    
print(diff)
Problem p02854 (python)

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

length = 0
lengths = []
for a in aaa:
  length += a
  lengths.append(length)
  
diffs = []
for l in lengths:
  diff = abs(l - (length - l))
  diffs.append(diff)
    
print(min(diffs))

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

length = 0
lengths = []
for a in aaa:
  length += a
  lengths.append(length)
  
diff = 200000 * 2020202020
for l in lengths:
  if abs(l - (length - l)) < diff:
    diff = abs(l - (length - l))
  else:
    break
    
print(diff)020202020
Problem p02934 (python)

Fixed submission:
n = int(input())

denominator = 0
for a in map(int, input().split()):
  denominator += 1 / a

print(1 / denominator)

Buggy submission (verdict: Runtime Error):
denominator = 0
for a in range(map(int, input().split())):
  denominator += 1 / a

print(1 / denominator)
Problem p02988 (python)

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

count = 0
for i in range(1, n - 1):
  if (Ps[i-1] < Ps[i]) and (Ps[i] < Ps[i+1]):
    count += 1
  elif (Ps[i-1] > Ps[i]) and (Ps[i] > Ps[i+1]):
    count += 1

print(count)

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

count = 0
for i in range(1, n - 1):
  if (p[i-1] < p[i]) and (p[i] < p[i+1]):
    count += 1
  elif (p[i-1] > p[i]) and (p[i] > p[i+1]):
    count += 1

print(count)
Problem p03000 (python)

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

d = 0
for i, l in enumerate(input().split()):
  d += int(l)
  if d > x:
    print(i + 1)
    break
else:
  print(n + 1)

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

d = 0
for i, l in enumerate(input().split()):
  d += int(l)
  if d > x:
    print(i + 1)
    break
else:
  prin(n + 1)

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

d = 0
for i, l in enumerate(input().split()):
  d += int(l)
  if d > x:
    print(i)
    break
else:
  prin(n)
Problem p03035 (python)

Fixed submission:
A, B = [int(x) for x in input().split(' ')]

if A >= 13:
  print(B)
elif 6 <= A < 13:
  print(B//2)
else:
  print(0)

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

As = list(map(int, input().split()))
As.sort()

BCs = []
for _ in range(M):
  b, c = tuple(map(int, input().split()))
  BCs.append((b, c))
BCs.sort(key=lambda x: x[1], reverse=True)
  
num = 0
i = 0
for b, c in BCs:
  for j in range(b):
    a = As[i]
    if a >= c or i == len(As):
      break
    else:
      num += c
      i += 1
  if a >= c or i == len(As):
    break
num += sum(As[i: ])
    
print(num)
Problem p03047 (python)

Fixed submission:
N, K = [int(x) for x in input().split(' ')]

output = N - K + 1

print(int(output))

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
d_list = []

for i in range(3, int(math.sqrt(N))):
  if N % i == 0:
    d_list.append(i)
    if i != math.sqrt(N):
      d_lsit.append(N / i)

output = sum(d_list) - (len(d_list) - 2) - 3
print(output)

Buggy submission (verdict: Runtime Error):
N = int(input())
s_list = []
count = 0
n, m, l = 0, 0, 0

for i in range(N):
  s = input()
  s_list.append(s)
  count += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    n += 1
    continue
  elif s[-1] == 'A':
    m += 1
  elif s[0] == 'B':
    l += 1

if n < m and n < l:
  print(int(count + 2 * n + min(m - n, l - n)))
elif n > m and n > l:
  print(int(count + 2 * (n - max(m, l) + m + l)
else:
  print(int(count + min(n, m) + min(n, l)))

Buggy submission (verdict: Runtime Error):
N = int(input())
s_list = []
count = 0
n, m, l = 0, 0, 0

for i in range(N):
  s = input()
  s_list.append(s)
  count += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    n += 1
    continue
  elif s[-1] == 'A':
    m += 1
  elif s[0] == 'B':
    l += 1

if n < m and n < l:
  print(int(count + 2 * n + min(m - n, l - n)))
elif n > m and n > l:
  print(int(count + 2 * (n - max(m, l) + m + l)
else:
  print(int(count + min(n, m) + min(n, l)))

Buggy submission (verdict: Runtime Error):
N = int(input())
s_list = []
count = 0
n, m, l = 0, 0, 0

for i in range(N):
  s = input()
  s_list.append(s)
  count += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    n += 1
    continue
  elif s[-1] == 'A':
    m += 1
  elif s[0] == 'B':
    l += 1

if n < m and n < l:
  print(int(count + 2 * n + min(m - n, l - n)))
else:
  print(int(count + 2 * n))
Problem p03049 (python)

Fixed submission:
N = int(input())
s_list = []
count = 0
n, m, l = 0, 0, 0
 
for i in range(N):
  s = input()
  s_list.append(s)
  count += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    n += 1
    continue
  elif s[-1] == 'A':
    m += 1
  elif s[0] == 'B':
    l += 1

if m == 0 and l == 0:
  if n == 0:
    print(int(count))
  else:
    print(int(count + (n - 1)))
else:
  print(int(count + min(n+m, n+l)))

Buggy submission (verdict: Runtime Error):
N = int(input())
s_list = []
count = 0
n, m, l = 0, 0, 0
 
for i in range(N):
  s = input()
  s_list.append(s)
  count += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    n += 1
    continue
  elif s[-1] == 'A':
    m += 1
  elif s[0] == 'B':
    l += 1

if m == 0 and l == 0:
  if n == 0:
    print(int(count))
  else:
  print(int(count + (n - 1)))
else:
  print(int(count + min(n+m, n+l)))

Buggy submission (verdict: Runtime Error):
N = int(input())
s_list = []
count = 0
n, m, l = 0, 0, 0

for i in range(N):
  s = input()
  s_list.append(s)
  count += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    n += 1
    continue
  elif s[-1] == 'A':
    m += 1
  elif s[0] == 'B':
    l += 1

if n < m and n < l:
  print(int(count + 2 * n + min(m - n, l - n)))
elif n > m and n > l:
  print(int(count + 2 * (n - max(m, l) + m + l)
else:
  print(int(count + min(n, m) + min(n, l)))

Buggy submission (verdict: Runtime Error):
N = int(input())
s_list = []
count = 0
n, m, l = 0, 0, 0

for i in range(N):
  s = input()
  s_list.append(s)
  count += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    n += 1
    continue
  elif s[-1] == 'A':
    m += 1
  elif s[0] == 'B':
    l += 1

if n < m and n < l:
  print(int(count + 2 * n + min(m - n, l - n)))
elif n > m and n > l:
  print(int(count + 2 * (n - max(m, l) + m + l)
else:
  print(int(count + min(n, m) + min(n, l)))

Buggy submission (verdict: Runtime Error):
N = int(input())
s_list = []
count = 0
n, m, l = 0, 0, 0

for i in range(N):
  s = input()
  s_list.append(s)
  count += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    n += 1
    continue
  elif s[-1] == 'A':
    m += 1
  elif s[0] == 'B':
    l += 1

if n < m and n < l:
  print(int(count + 2 * n + min(m - n, l - n)))
elif n > m and n > l:
  print(int(count + 2 * (n - max(m, l) + m + l)
else:
  print(int(count + min(n, m) + min(n, l)))

Buggy submission (verdict: Runtime Error):
N = int(input())
s_list = []
count = 0
n, m, l = 0, 0, 0

for i in range(N):
  s = input()
  s_list.append(s)
  count += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    n += 1
    continue
  elif s[-1] == 'A':
    m += 1
  elif s[0] == 'B':
    l += 1

if n < m and n < l:
  print(int(count + 2 * n + min(m - n, l - n)))
elif n > m and n > l:
  print(int(count + 2 * (n - max(m, l) + m + l)
else:
  print(int(count + min(n, m) + min(n, l)))
Problem p03050 (python)

Fixed submission:
import math
 
N = int(input())
d_list = []
 
for i in range(1, int(math.sqrt(N)) + 1):
  if N % i == 0:
    if i != 1:
      if (N // (i - 1)) == (N % (i - 1)):
        d_list.append(i)
    if i != math.sqrt(N):
      if (N // (N / i - 1)) == (N % (N / i - 1)):
        d_list.append(N / i)
 
output = sum(d_list) - len(d_list)
print(int(output))

Buggy submission (verdict: Runtime Error):
import math
 
N = int(input())
d_list = []
 
for i in range(3, int(math.sqrt(N))):
  if N % i == 0:
    d_list.append(i)
    if i != math.sqrt(N):
      d_lsit.append(N / i)
 
output = sum(d_list) - (len(d_list) - 2) - 3
print(output)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
d_list = []

for i in range(3, int(math.sqrt(N))):
  if N % i == 0:
    d_list.append(i)
    if i != math.sqrt(N):
      d_lsit.append(N / i)

output = sum(d_list) - len(d_list)
print(output)
Problem p02732 (python)

Fixed submission:
import math

n = int(input())
a = list(map(int, input().split()))

lib = [0] * n

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in a:
    lib[i - 1] += 1

count = 0

for i in lib:
    if i >= 2:
        count += comb(i, 2)

for i in a:
    print(count - (lib[i - 1] - 1))

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

lib = [0] * n

def comb(n, r):
    if r == 0 or r == n:
        return 1
    elif r == 1:
        return n
    else:
        return (comb(n - 1, r - 1) + comb(n - 1, r))

for i in a:
    lib[i - 1] += 1

count = 0

for i in lib:
    if i >= 2:
        count += comb(i, 2)

for i in a:
    print(count - (lib[i - 1] - 1))
Problem p02675 (python)

Fixed submission:
n = int(input())
m = n%10
if m == 2 or m == 4 or m == 5 or m == 7 or m == 9:
  print('hon')
elif m == 0 or m == 1 or m == 6 or m == 8:
  print('pon')
elif m == 3:
  print('bon')

Buggy submission (verdict: Runtime Error):
n = int(input())
m = n%10
if m == 2 or m == 4 or m == 5 or m == 7 or m == 9:
  return 'hon'
elif m == 0 or m == 1 or m == 6 or m == 8:
  return 'pon'
elif m == 3:
  return 'bon'
Problem p02582 (python)

Fixed submission:
s = list(input())
c = s.count("R")
if c == 3:
    print(3)
elif c == 2 and s[1] != "S":
    print(2)
elif c == 0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if l[i] == l[j] or l[j] == l[k] or l[k] == l[i]:
                continue

            else:
                # 3角形の成立条件
                if l[i] + l[j] > l[k] and l[j] + l[k] > l[i] and l[k] + l[i] > l[j]:
                    ans += 1
print(ans)
Problem p02602 (python)

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

for i in range(k, n):
    if a[i - k] < a[i]:
        print("Yes")
    else:
        print("No")

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

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
r = [0] * (n - k + 1)
for i in range(n - k + 1):
    if a[i + k] > a[i]:
        print("Yes")
    else:
        print("No")
Problem p02748 (python)

Fixed submission:
A, B, M = map(int, input().split())
x, y, c = [0] * M, [0] * M, [0] * M
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(M):
    x[i], y[i], c[i] = map(int, input().split())
ans, sav = float("inf"), 0
for j in range(M):
    sav = a[x[j] - 1] + b[y[j] - 1] - c[j]
    if ans > sav:
        ans = sav

print(min(ans, min(a) + min(b)))

Buggy submission (verdict: Runtime Error):
A, B, M = map(int, input().split())
x, y, c = [0] * M, [0] * M, [0] * M
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(M):
    x[i], y[i], c[i] = map(int, input().split())
ans = 0
sav = 0
maxc = max(c)
ci = c.index(maxc)
disc = a[ci - 1] + b[ci - 1] - maxc
print(min(disc, min(a) + min(b)))
Problem p02900 (python)

Fixed submission:
def primeFact(n):
    i = 2
    pl = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            pl.append(i)
        i += 1
    if n > 1:
        pl.append(int(n))
    return pl


a, b = map(int, input().split())
print(len(set(primeFact(a)) & set(primeFact(b))) + 1)

Buggy submission (verdict: Runtime Error):
import sympy as sym

a, b = map(int, input().split())
print(len(set(sym.primefactors(a)) & set(sym.primefactors(b))) + 1)
Problem p02971 (python)

Fixed submission:
n = int(input())
s = list(int(input()) for _ in range(n))
i = 0
sort_s = sorted(s)

for i in s:
    if i == sort_s[-1]:
        print(sort_s[-2])
    else:
        print(sort_s[-1])

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

input = sys.stdin.readline
n = int(input())
s = list(int(input()) for _ in range(n))
i = 0
maxn = 0
s2 = []
while i < n:
    s2 = s.copy()
    del s2[i]
    print(np.max(np.array(s2)))
    i += 1

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

input = sys.stdin.readline
n = int(input())
s = list(int(input()) for _ in range(n))
i = 0
maxn = 0
s2 = []
while i < n:
    s2 = s.copy()
    del s2[i]
    print(np.max(np.array(s2)))
    i += 1
Problem p03087 (python)

Fixed submission:
n, q = list(map(int, input().split()))
s = input()
t = [0] * (n + 1)
for i in range(n):
    t[i + 1] = t[i] + (1 if s[i : i + 2] == "AC" else 0)

for i in range(q):
    l, r = list(map(int, input().split()))
    print(t[r - 1] - t[l - 1])

Buggy submission (verdict: Runtime Error):
n, q = list(map(int, input().split()))
s = list(input())
lr = [list(map(int, input().split())) for i in range(q)]
ac = [0] * 10 ** 5
for i in range(n):
    if i < n:
        if s[i] == "A" and s[i + 1] == "C":
            ac[i + 1] = 1
for i in range(q):
    print(ac[lr[i][0] : lr[i][1]].count(1))
Problem p03102 (python)

Fixed submission:
n, m, c = list(map(int, input().split()))
B = list(map(int, input().split()))
A = (list(map(int, input().split())) for _ in range(n))
ans = 0
cnt = 0
for i, u in enumerate(A):
    for j, v in enumerate(u):
        ans += v * B[j]

    ans += c
    if ans > 0:
        cnt += 1
    ans = 0
print(cnt)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
K, A = [0] * N, [0] * N
for i in range(N):
    K[i], *A[i] = list(map(int, input().split()))
k = set(i for i in range(1, M + 1))
ki = k.intersection(*A)
print(len(ki))
Problem p03206 (python)

Fixed submission:
D = int(input())
c = "Christmas"
e = " Eve"
print(c, end="")
if D != 25:
    for i in range(25 - D):
        print(e, end="")
print()

Buggy submission (verdict: Runtime Error):
import math

n, k = list(map(int, input().split()))
h = [int(input()) for _ in range(n)]
h.sort()
ans = math.inf
for i in range(n - k + 1):
    ans = min(ans, h[i + k - 1] - h[i])

print(ans)
Problem p03211 (python)

Fixed submission:
n = int(input())
sn = str(n)
n3 = 0
minx = 0
temp = 754
for i in range(len(str(n // 100))):
    n3 = int(sn[i : i + 3])
    minx = abs(753 - n3)
    if temp > minx:
        temp = minx

print(temp)

Buggy submission (verdict: Runtime Error):
n = int(input())
sn = str(n)
minx = 0
temp = 754
sav = 0
for i in range(len(str(n//100))):
    minx = abs(753-int(sn[i:i+3]))
    if temp > minx:
        temp = minx
        sav = n3

print(sav)
Problem p03386 (python)

Fixed submission:
a, b, k = list(map(int, input().split()))
al, bl = [], []
if a == b:
    print(a)
else:   
    for i in range(min(b-a,k)):
        al.append(a+i)
        bl.append(b-i)
        ans = list(set(al) | set(bl))
    ans.sort()
    for i in ans:
        print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = list(map(int, input().split()))
al, bl = [], []
for i in range(min(b-a,k)):
    al.append(a+i)
    bl.append(b-i)
    ans = list(set(al) | set(bl))
ans.sort()
for i in ans:
    print(i)
Problem p03624 (python)

Fixed submission:
a = "abcdefghijklmnopqrstuvwxyz"
s = set(input())
c = 0

for i in s:
    a = a.replace(i,"")
    c += 1
if c < 26:
    print(a[0])
else:
    print("None")

Buggy submission (verdict: Runtime Error):
a = "abcdefghijklmnopqrstuvwxyz"
s = set(input())
for i in s:
    a = a.replace(i,"")
print(a[0])