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

Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy submission (verdict: Runtime Error):
from math import factorial
N, a, b = map(int, input().split())
m=0
for i in range(N):
    if i==a, or i==b
        k=0
        m=m+k
    if not i== a-1 or i==b-1:
        k= factorial(N) // ((factorial(N - (i+1)) * factorial(i+1)))
        m=m+k
    print(m)

Buggy submission (verdict: Runtime Error):
from math import factorial
N, a, b = map(int, input().split())
m=0
for i in range(N):
    if not i== a-1 or i==b-1:
        k=factorial(N) // (factorial(N - (i+1)) * factorial(i+1))
        m=m+k
    print(m)

Buggy submission (verdict: Runtime Error):
N = int(stdin.readline().rstrip())
A = int[stdin.readline().rstrip().split() for _ in range(n)]
P=round(sum(A)/N)
B=0
for i in range(N):
    B=B+(A[i]-P)**2
print(B)

Buggy submission (verdict: Runtime Error):
n = int(stdin.readline().rstrip())
data = int[stdin.readline().rstrip().split() for _ in range(n)]
P=round(sum(A)/N)
B=0
for i in range(N):
  B=B+(A[i]-P)**2
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
P=round(sum(A)/N)
B=0
for i in range(N):
  B=B+(A[i]-P)**2
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [input() for i in range(N)]
P=round(sum(A)/N)
B=0
for i in range(N):
  B=B+(A[i]-P)**2
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [input() for i in range(N)]
P=round(sum(A)/N)
B=0
for i in range(N):
  B=B+(A[i]-P)**2
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [input() for i in range(N)]
P=round(sum(A)/N)
B=0
for i in range(N):
	B=B+(A[i]-P)**2
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split())) 
P=round(sum(A)/N)
B=0
for i in range(N):
	B=B+(A[i]-P)**2
print(B)

Buggy submission (verdict: Runtime Error):
N = input()
for i in range(N):
	A = [int(i) for i in input().split()]
P=round(sum(A)/N)
B=0
for i in range(N):
	B=B+(A[i]-P)**2
print(B)
Problem p02767 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split())) 
P=round(sum(A)/N)
B=0
for i in range(N):
    B=B+(A[i]-P)**2
print(B)

Buggy submission (verdict: Runtime Error):
N = input()
for i in N:
	A = [int(i) for i in input().split()]
P=round(sum(A)/N)
B=0
for i in N:
	B=B+(A[i]-P)**2
print(B)
Problem p02909 (python)

Fixed submission:
S=input()
if S=="Sunny" :
	print("Cloudy")
elif S=="Cloudy" :
	print("Rainy")
else :
	print("Sunny")

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(Q):
    S.append(int(input())) 
P=np.array([K]*N)
for i in range(Q):
  P[S[i]-1]+=1
P -= Q
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")
Problem p02910 (python)

Fixed submission:
S=input()
a = 0
for i in range(len(S)):
  if i%2==0 :
    if S[i] != "L":
    	a += 1
  else:
    if S[i] != "R":
    	a += 1
if a == len(S):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
a = 0
for i in range(len(S)):
  if i%2==1 :
    if S[i] != "L":
    a += 1
  else:
    if S[i] != "R":
    a += 1
if a == len(S):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S=input()
a = 0
for i in renge(len(S)):
  if i%2==1 :
    S[i] != "L"
    a += 1
  else:
    S[i] != "R"
    a += 1
if a == len(S):
  print("Yes")
else:
  print("No")
Problem p02911 (python)

Fixed submission:
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(Q):
    S.append(int(input())) 
P=[K]*N
for i in range(Q):
  P[S[i]-1]+=1
P = np.array(P)
P -= Q
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(H):
    S.append(int(input())) 
P=np.array([K]*N)
for i in range(Q):
  a=[-1]*N
  a[S[i]]=0
  P +=a
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")
Problem p02687 (python)

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

Buggy submission (verdict: Runtime Error):
def main():
  import sys
  input = sys.stdin.readline
  n, m = map(int, input().split())
  h = list(map(int, input().split()))
  ab = [list(map(int, input().split())) for _ in range(m)]
  L = [0] * n

  for i in range(m):
      A =ab[i][0]-1
      B =ab[i][1]-1
      M = max(h[A],h[B])
      if M == h[A]:
          L[A] += 0.33
          L[B] -= 100
      else: 
          L[B] += 0.33
          L[A] -= 100
      
  L= list(filter(lambda x: x >= 0, L))
  print(len(L))

if __name__ == '__main__':
    main()
Problem p02687 (python)

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

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

Fixed submission:
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
 
print(min(n % k, abs(n % k - k)))

Buggy submission (verdict: Runtime Error):
line1 = input().split()
n = int(line1[0])
k = int(line1[1])

print(min(n % k, abs(n % k - k))
Problem p02721 (python)

Fixed submission:
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
c = int(line1[2])
s = list(input())
l = [s.index("o") + 1]
r = [len(s) - s[::-1].index("o")]
for i in range(1, k):
  j = l[i - 1]
  m = r[i - 1]
  while j - l[i - 1] <= c or s[j - 1] != "o":
    j += 1
  while r[i - 1] - m <= c or s[m - 1] != "o":
    m -= 1
  r.append(m)
  l.append(j)
r = r[::-1]
for i in range(len(r)):
  if r[i] == l[i]:
    print(r[i])

Buggy submission (verdict: Runtime Error):
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
c = int(line1[2])
s = list(input())
t = s[::-1]
l = [s.index("o") + 1]
r = [len(s) - t.index("o")]
for i in range(1, k):
  j = l[i - 1]
  m = r[i - 1]
  while j - l[i - 1] <= c or s[j] != "o":
    j += 1
  while r[i - 1] - m <= c or t[m] != "o":
    m -= 1
  r.append(m + 1)
  l.append(j + 1)
d = set(r) & set(l)
for i in d:
  print(i)
Problem p04043 (python)

Fixed submission:
def ispossible(list1):
  if list1.count("5") == 2 and list1.count("7") == 1:
    return "YES"
  else:
    return "NO"

list1 = input().split()
print(ispossible(list1))

Buggy submission (verdict: Runtime Error):
def ispossible(list1):
  if list1.count("5") == 2 and list1.count("7") == 1:
    return "YES"
  else:
    return "NO"

list1 = input().split()
print(isposible(list1))

Buggy submission (verdict: Runtime Error):
def ispossible(list1):
  if list1.count("5") == 2 and list1.count("7") == 1:
    return "YES"
  else:
    return "NO"

list1 = input().split()
print(ispposible(list1))
Problem p04044 (python)

Fixed submission:
def order(str1, str2):
  for i in range(len(str1)):
    if ord(str1[i]) > ord(str2[i]):
      return False
    elif ord(str1[i]) == ord(str2[i]):
      continue
    else:
      return True
 
def sort(str_list):
  for i in range(len(str_list) - 1):
    for j in range(i + 1, len(str_list)):
      if not order(str_list[i], str_list[j]):
        temp = str_list[i]
        str_list[i] = str_list[j]
        str_list[j] = temp
  ans = ""
  for i in str_list:
    ans += i
  return ans
 
line1 = input().split()
n = int(line1[0])
l = line1[1]
str_list = []
for i in range(n):
  str_list.append(input())
print(sort(str_list))

Buggy submission (verdict: Runtime Error):
def sort(str_list):
  for i in range(len(str_list) - 1):
    string = str_list[i]
    for j in range(i + 1, len(str_list)):
      next_string = str_list[j]
      for k in range(len(string)):
        if ord(string[k]) > ord(next_string[k]):
          temp = string
          str_list[i] = next_string
          str_list[j] = temp
          break
        elif ord(string[k]) == ord(next_string[k]):
          continue
        else:
          break
  ans = ""
  for i in str_list:
    ans += i
  return ans
 
line1 = input().split()
n = line1[0]
l = line1[1]
str_list = []
for i in range(n):
  str_list.append(input())
print(sort(str_list))
  
def sort(str_list):
  for i in range(len(str_list) - 1):
    string = str_list[i]
    for j in range(i + 1, len(str_list)):
      next_string = str_list[j]
      for k in range(len(string)):
        if ord(string[k]) > ord(next_string[k]):
          temp = string
          str_list[i] = next_string
          str_list[j] = temp
          break
        elif ord(string[k]) == ord(next_string[k]):
          continue
        else:
          break
  ans = ""
  for i in str_list:
    ans += i
  return ans

line1 = input().split()
n = int(line1[0])
l = line1[1]
str_list = []
for i in range(n):
  str_list.append(input())
print(sort(str_list))

Buggy submission (verdict: Runtime Error):
def sort(str_list):
  for i in range(len(str_list) - 1):
    string = str_list[i]
    for j in range(i + 1, len(str_list)):
      next_string = str_list[j]
      for k in range(len(string)):
        if ord(string[k]) > ord(next_string[k]):
          temp = string
          str_list[i] = next_string
          str_list[j] = temp
          break
        elif ord(string[k]) == ord(next_string[k]):
          continue
        else:
          break
  ans = ""
  for i in str_list:
    ans += i
  return ans

line1 = input().split()
n = line1[0]
l = line1[1]
str_list = []
for i in range(n):
  str_list.append(input())
print(sort(str_list))
Problem p04045 (python)

Fixed submission:
def function1(m, set1):
  set2 = set(str(m))
  if len(set1 & set2) > 0:
    return False
  else:
    return True
def function(n, set1):
  m = n
  while not function1(m, set1):
    m += 1
  return m

line1 = input().split()
n = int(line1[0])
k = int(line1[1])
list1 = input().split()
set1 = set(list1)

print(function(n, set1))

Buggy submission (verdict: Runtime Error):
def function(m, set1):
  set2 = set(str(m))
  if len(set1 & set2) > 0:
    return False
  else:
    return True
def function(n, set1):
  m = n
  while not function(m, set1):
    m += 1
  return m

line1 = input().split()
n = int(line1[0])
k = int(line1[1])
list1 = []
for i in range(k):
  list1.append(int(input()))
set1 = set(list1)

print(function(n, set1))
Problem p02767 (python)

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

x.sort()
cnt = 0
minimum = 0
for i in range(x[0], x[-1] + 1):
    for j in range(n):
        cnt += (x[j] - i) ** 2

    if i == x[0]:
        minimum = cnt

    minimum = min([minimum, cnt])
    cnt = 0

print(minimum)

Buggy submission (verdict: Runtime Error):

n = int(input())
x = list(map(int,input().split()))
x.sort()
cnt = 0
min = 0

for i in range(x[0], x[-1] + 1):
    for j in range(n):
        cnt += (x[j] - i) ** 2

    if i == x[0]:
        minimum = cnt

    minimum = min([minimum, cnt])
    cnt = 0

print(minimum)
Problem p02791 (python)

Fixed submission:

n = int(input())
p = list(map(int,input().split()))
ans = 0
currentMin = 10 ** 9
s = []

for i in range(n):
    if currentMin > min(currentMin,p[i]):
        currentMin = min(currentMin,p[i])
        s.append(currentMin)
    else:
        s.append(currentMin)

for i in range(len(p)):
    if p[i] == s[i]:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())
p = list(map(int,input().split()))
ans = 1
l = []

for i in range(1,n+1):
    l = p[0:i]
    if p[i] <= min(l):
        ans += 1
    else:
        pass

print(ans)
Problem p02802 (python)

Fixed submission:

n, m = map(int, input().split())
bool_lst = [False] * n
ac_lst = [0] * n
wa_lst = [0] * n
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if bool_lst[p] == False:
        if s == 'AC':
            bool_lst[p] = True
            ac_lst[p] += 1
        else:
            wa_lst[p] += 1

ac_cnt = 0
wa_cnt = 0
for i in range(n):
    if bool_lst[i] == True:
        ac_cnt += ac_lst[i]
        wa_cnt += wa_lst[i]

print(ac_cnt, wa_cnt)

Buggy submission (verdict: Runtime Error):

n,m = map(int,input().split())
ans = [0]*n
miss = [0]*n

for _ in range(m+1):
    p,s = map(str,input().split())
    p = int(p)
#    print(p,s)
    if ans[p-1] == 0 and s == "WA":
        miss[p-1] += 1
    elif ans[p-1] == 0 and s == "AC":
        ans[p-1] += 1
    else:
        pass

#print(ans)
#print(miss)
a = sum(ans)
b = sum(miss)

print(a,b)
Problem p02854 (python)

Fixed submission:

n = int(input())
a = list(map(int,input().split()))
d = [0]

for i in range(n):
    d.append(d[i] + a[i])

ans = d[-1]

for i in range(n):
    ans =min(ans,abs(d[-1] -2*d[i]))
print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())
a = list(map(int,input().split()))
d = [0]

for i in range(n):
    d.append(d[i] ;a[i])

ans = d[-1]

for i in range(n):
    ans =min(ans,abs(d[-1] -2*d[i]))
print(ans)
Problem p02885 (python)

Fixed submission:

a,b = map(int,input().split())

if a <= 2*b:
    print(0)
else:
    print(a - 2*b)

Buggy submission (verdict: Runtime Error):

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

Fixed submission:
n = int(input())
s = input()
ans = 1
for i in range(n-1):
    if s[i] != s[i+1]:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())
s = input()

ans = 1
for i in range(n-1):
    if s[i] != a[i + 1]:
        ans += 1
print(ans)
Problem p02898 (python)

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

count = 0

for i in a:
    if i>= k:
        count += 1
print(count)

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

h = input().split()

count = 0

for i in range(n):
    if h[i] >= K:
        count += 1
    else:
        pass

print(count)

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

h = list(map(int, input().split()))

count = 0

for i in range(n):
    if h[i] >= K:
        count += 1
    else:
        pass

print(count)
Problem p02983 (python)

Fixed submission:
l,r = map(int,input().split())
m = r-l

if m >= 2019:
  print(0)
else:
  cnt = []
  for i in range(l,r):
    for j in range(l+1,r+1):
      cnt.append(i*j%2019)
  print(min(cnt))

Buggy submission (verdict: Runtime Error):

L,R = map(int,input().split())
if R-L >= 2019:
    print(0)
else:
    ans = []
    for i in range(L,R):
        ans.append(i*j*2019)
    print(min(ans))

Buggy submission (verdict: Runtime Error):

L,R = map(int,input().split())
if R-L >= 2019:
    print(a)
else:
    ans = []
    for i in range(L,R):
        ans.append(i*j*2019)
    print(min(ans))
Problem p02995 (python)

Fixed submission:

import math,fractions
A,B,C,D=map(int,input().split())
E=C*D//fractions.gcd(C,D)

ac=(A-1)//C
ad=(A-1)//D
bc=B//C
bd=B//D
ae=(A-1)//E
be=B//E

s= bc-ac
t= bd-ad
u= be-ae

print(B-A+1 - s -t +u)

Buggy submission (verdict: Runtime Error):

import math
a,b,c,d = map(int,input().split())

#cとdの最小公倍数を求める(lcm = least common multiple)
lcm (c*d)/math.gcd(c,d)

ac = (A-1) // c
ad = (A-1) // d

bc = b // c
bd = b // d

ae = (A-1) // lcm
be = b // lcm

s = bc - ac
t = bd - ad
u = be - ae

print(b-a+1-s-t+u)
Problem p03030 (python)

Fixed submission:

n = int(input())
sp = [list(input().split())+[i+1] for i in range(n)]
sp = [[s,-int(p),i] for s,p,i in sp]

sp.sort()

for s,p,i in sp:
    print(i)

"""
from operator import itemgetter

n = int(input())
l = []

for i in range(n):
    s,p = map(str,input().split())
    p = int(p)
    l.append([s,p,i+1])

l.sort(key = itemgetter(0))
l = sorted(l, key = lambda x:(x[1]),reverse = True)
print(l)
"""

Buggy submission (verdict: Runtime Error):

n = int(input())
sp = [list(input().split())+[i+1] for i in range(n)]
sp = [[s,-int(p),i] for s,p,i in sp]

sp.sort()
print(sp)

for i in sp:
  print(sp[i][2])

"""
from operator import itemgetter

n = int(input())
l = []

for i in range(n):
    s,p = map(str,input().split())
    p = int(p)
    l.append([s,p,i+1])

l.sort(key = itemgetter(0))
l = sorted(l, key = lambda x:(x[1]),reverse = True)
print(l)
"""

Buggy submission (verdict: Runtime Error):

n = int(input())
a = ""
b = 0
l = []

for i in range(1,n+1):
    a,b = map(str,input().split())
    b = int(b)
    l.append([a,b,i])
l.sort()

pprint.pprint(l)

for i in range(n):
    print(l[i][2])
Problem p03068 (python)

Fixed submission:

n = int(input())
s = list(input())
k = int(input())

a = s[k-1]

for i in range(n):
    if s[i] != a:
        s[i] = "*"
print("".join(s))

Buggy submission (verdict: Runtime Error):

n = int(input())
s = list(input())
k = int(input())

a = s[k-1]

for i in range(n):
    if s[i] != a:
        s[i] = "*"
print("".jpin(s))
Problem p03076 (python)

Fixed submission:

from itertools import permutations

dishes = [int(input()) for _ in range(5)]

minT = 10000
for sample in permutations(dishes, 5):
    t = 0
    for dish in sample:
        if t%10 != 0:
            t += 10 - t%10
        t += dish
    minT = min(minT, t)
print(minT)

Buggy submission (verdict: Runtime Error):

a = [int(input()) for _ in range(5)]
b = []
for i in range(len(a)):
    if a[i] % 10 == 0:
        b.append(0)
    else:
        b.append(10 - (a[i] % 10))
        c = b.index(max(b))

ans = 0
for i in range(5):
    if i !=c:
        if a[i] % 10 == 0:
            ans += a[i]
        else:
            ans += ((a[i] // 10) + 1) * 10
print(ans+a[c])
Problem p03095 (python)

Fixed submission:

n = int(input())
s = list(input())
t = []
ans = 1
count= []

t = set(s)
t = list(t)

for i in range(len(t)):
    count.append(s.count(t[i]))

for j in range(len(count)):
    ans *= (count[j] + 1)

print((ans-1)%(10**9 + 7))

Buggy submission (verdict: Runtime Error):

n = int(input())
s = list(input())
t = []
ans = 1
count= []

t = set(s)
t = list(t)

for i in range(len(t)):
    count.append(s.count(t[1]))

for j in range(len(count)):
    ans *= (count[i] + 1)
print(ans-1)
Problem p03106 (python)

Fixed submission:

a,b,k = map(int,input().split())
l = []
c = min(a,b)
d = max(a,b)

for i in range(1,c+1):
    if c % i == 0 and d % i == 0:
        l.append(i)

#print(l)
print(l[-k])

Buggy submission (verdict: Runtime Error):

a,b,k = map(int,input().split())
c = min(a,b)
t = []

for i in range(1,c):
    if a % i == 0 and b % i == 0:
        t.append(i)
print(t[1])
Problem p03109 (python)

Fixed submission:

s = list(input())

if (int(s[5])*10 + int(s[6])) <= 4 and (int(s[8])*10 + int(s[9])) <=30:
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):

s = list(int(input()))

if (s[5]*10 + s[6]) <= 4 and (s[8]*10 + s[9]) <=30:
    print("Heisei")
else:
    print("TBD")
Problem p03126 (python)

Fixed submission:

n,m = map(int,input().split())
ans = [0] * m
info = []

for i in range(n):
    info = list(map(int,input().split()))
    for j in range(1,info[0]+1):
        ans[info[j]-1] += 1
#    print(ans)

print(ans.count(n))

Buggy submission (verdict: Runtime Error):

n,m = map(int,input().split())
t = [0]*m
s = []

for i in range(n):
    a = list(map(int,input().split()))
    for j in range(1,a[0]+1):
        t[a[j]] += 1

count = 0

for i in range(len(t)):
    if t[i] == n:
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):

n,m = map(int,input().split())
t = [0]*m
s = []

for i in range(n):
    a = list(map(int,input().split()))
    for j in range(a[0]):
        t[a[j]] += 1

count = 0

for i in range(len(t)):
    if t[i] == n:
        count += 1

print(count)
Problem p03145 (python)

Fixed submission:

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

print(int(((a*b)/2)))

Buggy submission (verdict: Runtime Error):

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

printint(((a*b*c)/2))
Problem p03206 (python)

Fixed submission:

d = 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 = 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")
Problem p03262 (python)

Fixed submission:
n,x = map(int,input().split())
a = list(map(int,input().split()))
new_lst=[abs(i-x) for i in a]

def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

ans=new_lst[0]
for i in range(1,n):
	ans =gcd(new_lst[i],ans)

print(ans)

Buggy submission (verdict: Runtime Error):

n,x = map(int,input().split())
x = list(map(int,input().split()))
l = [abs(i-x) for i in x]

#ユークリッド互除法
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)

ans = l[0]
for i in range(1,n):
    ans = gcd(l[i],ans)
print(ans)

Buggy submission (verdict: Runtime Error):

n,x = map(int,input().split())
x = list(map(int,input().split()))
l = [abs(i-x) for i in x]

#ユークリッド互除法
def gcd(x,y):
    if y == 0:
        return
    else:
        return gcd(y,x%y)

ans = l[0]
for i in range(1,n):
    ans = gcd(l[i],ans)
print(ans)
Problem p03288 (python)

Fixed submission:

r = int(input())

if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):

r = int(input())

if r < 1200:
    print("ABC")
elif r 2800:
    print("ARC")
else:
    print("AGC")
Problem p03292 (python)

Fixed submission:

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

print(abs(a[2]-a[0]))

Buggy submission (verdict: Runtime Error):

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

print(ans(a[3]-a[1]))
Problem p03338 (python)

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

ans = 0
for i in range(1, n):
    head = s[:i]
    tail = s[i:]
    cnt = 0
    for i in range(26):
        c = chr(ord('a') + i)
        if c in head and c in tail:
            cnt += 1

    ans = max(ans, cnt)

print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())
s = input()

ans = 0

for i in range(1, n):
    h = s[:i]
    t = s[i:]
    cnt = 0
    for j in range(26):
        c = chr(ord('a') + j)
        if c in head and c in tail:
            cnt += 1

    ans = max(ans, cnt)

print(ans)
Problem p03386 (python)

Fixed submission:

a,b,k = map(int,input().split())
ans = []

for i in range(k):
    if a + i > b:
        break
    ans.append(a+i)

#print(ans)
for j in range(k):
    if b-j<a:
        break
    ans.append(b-j)
v = set(ans)
w = list(v)
w.sort()
#print(w)

for l in w:
    print(l)

Buggy submission (verdict: Runtime Error):

a,b,k = map(int,input().split())
l = [i for i in range(a,b+1)]
ans = []

for i in range(k):
    ans.append(l[i])
    ans.append(l[(i+1)*(-1)])
ans = set(ans)
ans = list(ans)
ans.sort()
for i in range(len(ans)):
    print(ans[i])
Problem p03456 (python)

Fixed submission:

a,b = input().split()
ab = int(a+b)

print("Yes" if ab%(ab**0.5)==0 else "No")

Buggy submission (verdict: Runtime Error):

a,b = inut().split()
ab = int(a+b)

print("Yes" if ab%(ab**0.5)==0 else "No")
Problem p03606 (python)

Fixed submission:

n = int(input())
ans = 0

for i in range(n):
    l,r = map(int,input().split())
    ans += r-l+1

print(ans)

Buggy submission (verdict: Runtime Error):
2
6 8
3 3
Problem p03658 (python)

Fixed submission:

N,K = map(int,input().split())
l = list(map(int,input().split()))

k = sorted(l)

ans = 0

for i in range(K):
    ans += k.pop()

print(ans)

Buggy submission (verdict: Runtime Error):

N,K = map(int,input().split())
l = list(map(int,input().split()))

k = sorted(l)

print(k[-1] + k[-2] + k[-3])
Problem p03665 (python)

Fixed submission:

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

num = 0
count = 0

for i in range(n):
    if a[i] % 2 == 0:
        count += 1

if count == n:
    if p == 0:
        print(2**n)
    elif p == 1:
        print(0)
else:
    print(2**(n-1))

Buggy submission (verdict: Runtime Error):

n = int(input())
a = list(map(int,input().split()))
ans = 0
b = []

for i in range(n):
    for j in range(i+1,n+1):
        b = a[i:j]
#        print(b)

        if sum(b) == 0:
            ans += 1

print(ans)