Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import bisect
N = int(input())
L = list(map(int,input().split()))
L.sort()
sum = 0
for i in range(0,N):
  L_1st= L[i]
  for j in range(i+1,N):
    L_2nd = L[j]
    c_min = b-a+1
    c_max = b+a-1
    l = bisect.bisect_left(Ls,c_min,lo = j+1)
    if l!= N:
      r = bisect.bisect_right(Ls,c_max,lo = j+1)
      if r:
        r = r-1
        if r>= l:
          sum += r-l+1
print(sum)


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

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
L = list(map(int,input().split()))
B = []
s = 0
for i in range(N-2):
    for k in range(i+1,N-1):
        for _ in range(k+1,N):
            if L[i]-L[k]<L[_] and L[k]-L[i]<L[_] and L[_]<L[i]+L[k]:
                s = (L[i]+L[k]+L[_])/2
                B.append(math.sqrt(s*(s-L[i])*(s-L[k])*(s-L[_])))
k = set(B)
k = list(k)
print(len(k))


Fixed submission:
A,B = map(int,input().split())
if (A-2*B)<0:
  print(0)
else:
  print(A-2*B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ls = [0]*N
for i in range(N):
    ls[i] = A.index(i+1)
def plus(n):
    return n + 1
ls = map(plus,ls)
print(*ls)

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

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int,input().split()))
ls = [0]*N
for i in range(N):
    ls[i] = A.index(i+1)
np.add(ls+1)
print(*ls)

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ls = [0]*N
for i in range(N):
    ls[i] = A.index(i+1)+1
print(*ls)

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ls = []
for i in range(N):
    ls.append(A.index(i+1)+1)
print(*ls)

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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ls = []
k = 0
for i in range(N):
    k = A.index(i+1)+1
    ls.append(k)
print(*ls)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ls = [0]*N
for i in range(N):
    ls[A[i]-1] = i+1
print(*ls)
Buggy python submission (verdict: Runtime Error):
kuti = 1
k = 0
for i in range(100):
    if kuti>=B:
        print(k)
        break
    elif B == 1:
        print(0)
    else:
        kuti += A-1
        k += 1

Fixed submission:
A,B = map(int,input().split())
kuti = 1
k = 0
for i in range(100):
    if kuti>=B:
        print(k)
        break
    elif B == 1:
        print(0)
    else:
        kuti += A-1
        k += 1
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
v = list(map(int,input().split()))
v_new = 0
#新しい具材の価値をv_newとした
a = 0
k = []
#kで
p = N
for i in range(N-1):
    #全ての要素が同じ場合は終了する
    if v.count(v[0]) == p:
        break
    else:
       x = v[(math.ceil(len(v)/2))]
       v.remove(x)
       #xをvのリストから除外
       for j in range(len(v)):
           k.append(v[j])
       for j in range(len(k)):
           k[j] = abs(k[j]-x)
       a = k.index(min(k))
       y = v[a]
       k.clear()
       #kのリストを初期化
       v_new = (x+y)/2
       #価値を(x+y)/2とした
       v.append(v_new)
       #v_newをvのリストに挿入
       v.remove(y)
       #yをvのリストから除外
       v_new = 0
       #v_newを初期化
       p = p-1
       a = 0
       x = 0
       y = 0
print(v[0])

Fixed submission:
import math
N = int(input())
v = list(map(int,input().split()))
v_new = 0
#新しい具材の価値をv_newとした
a = 0
k = []
#kで
p = N
for i in range(N-1):
    #全ての要素が同じ場合は終了する
    if v.count(v[0]) == p:
        break
    else:
       x = min(v)
       v.remove(x)
       #xをvのリストから除外
       y = min(v)
       v_new = (x+y)/2
       #価値を(x+y)/2とした
       v.append(v_new)
       #v_newをvのリストに挿入
       v.remove(y)
       #yをvのリストから除外
       v_new = 0
       #v_newを初期化
       p = p-1
       a = 0
       x = 0
       y = 0
print(v[0])

Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
v = list(map(int,input().split()))
s = v
v_new = 0
a = 0
k = []
p = N
for i in range(N-1):
    if v.count(v[0]) == p:
        break
    else:
       x = v[(math.ceil(len(v)/2))]
       v.remove(x)
       for j in range(len(v)):
           k.append(v[j])
       for j in range(len(k)):
           k[j] = abs(k[j]-x)
       a = k.index(min(k))
       y = v[a]
       v_new = (x+y)/2
       v.append(v_new)
       v.remove(y)
       v_new = 0
       p = p-1
print(v[0])

Fixed submission:
import math
N = int(input())
v = list(map(int,input().split()))
v_new = 0
#新しい具材の価値をv_newとした
a = 0
k = []
#kで
p = N
for i in range(N-1):
    #全ての要素が同じ場合は終了する
    if v.count(v[0]) == p:
        break
    else:
       x = min(v)
       v.remove(x)
       #xをvのリストから除外
       y = min(v)
       v_new = (x+y)/2
       #価値を(x+y)/2とした
       v.append(v_new)
       #v_newをvのリストに挿入
       v.remove(y)
       #yをvのリストから除外
       v_new = 0
       #v_newを初期化
       p = p-1
       a = 0
       x = 0
       y = 0
print(v[0])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
k = []
for i in range(N):
  k.append(int(input()))
p = k
x = k.index(max(k))
for i in range(N):
  if i==x:
    p.sort()
    print(p[-2])
  else:
    print(max(k))

Fixed submission:
N = int(input())
k = []
for i in range(N):
    k.append(int(input()))
B = k.copy()
B.sort()
B.reverse()
P = B[0]
Q = B[1]
for i in range(N):
    if k[i] == P:
        print(Q)
    else:
        print(P)
Buggy python submission (verdict: Runtime Error):
import math
N,D = map(int,input().split())
k = []
ans_2 = 0
ans_1 = 0
for i in range(N):
    k.append(list(map(int,input().split())))
for i in range(0,N):
    for j in range(i+1,N):
        for _ in range(D):
            now += (k[i][_]-k[j][_])**2
        ans_1 = math.sqrt(now)
        if ans_1%1 == 0:
            ans_2 += 1
        now = 0
        ans_1 = 0
print(ans_2)

Fixed submission:
import math
N,D = map(int,input().split())
k = []
ans_2 = 0
ans_1 = 0
now = 0
for i in range(N):
    k.append(list(map(int,input().split())))
for i in range(0,N):
    for j in range(i+1,N):
        for _ in range(D):
            now += (k[i][_]-k[j][_])**2
        ans_1 = math.sqrt(now)
        if ans_1%1 == 0:
            ans_2 += 1
        now = 0
        ans_1 = 0
print(ans_2)

Buggy python submission (verdict: Runtime Error):
N,D = map(int,input().split())
#N,Dを入力
k = []
#座標のリストを作成
a = 0
#一時的に代入する値を作成
for i in range(N):
  k.append(map(int,input().split())
for i in range(N):
  for j in range(D):
#D回をN回繰り返す
    a += (k[i][j]-k[i+1][j])**2
  a = sqrt(a)
  if a%1 == 0:
  ans += 1
print(ans)

Fixed submission:
import math
N,D = map(int,input().split())
k = []
ans_2 = 0
ans_1 = 0
now = 0
for i in range(N):
    k.append(list(map(int,input().split())))
for i in range(0,N):
    for j in range(i+1,N):
        for _ in range(D):
            now += (k[i][_]-k[j][_])**2
        ans_1 = math.sqrt(now)
        if ans_1%1 == 0:
            ans_2 += 1
        now = 0
        ans_1 = 0
print(ans_2)
Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int,input().split())
minimum = 2019
for i in range(l,r+1):
  for j in range(i+1,r+1):
    if (i*j)%2019 == 0:
      minimum = 0
      break
    else:
      if (i*j)%2019 < minimum:
        minimum = (i*j)%2019
print(minimum)

Fixed submission:
l,r = map(int,input().split())
minimum = 2019
for i in range(l,r+1):
  if minimum == 0:
    break
  for j in range(i+1,r+1):
    if (i*j)%2019 == 0:
      minimum = 0
      break
    else:
      if (i*j)%2019 < minimum:
        minimum = (i*j)%2019
print(minimum)
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = sorted(list(map(int,input().split())))
print(d[n//2]-d[n//2-1])

Fixed submission:
#ABC132 = 2*2*3*11
S = input()
A = []
for i in range(len(S)):
    A.append(S[i])
if S[0] == S[1] and S[2] == S[3] or S[0] == S[2] and S[1] == S[3] or S[0] == S[3] and S[1] == S[2]:
    if A.count(S[0]) == 4:
        print("No")
    else:
        print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
W,H,x,y = map(int,input().split())
K.append((W*H)/2)
if x == W/2 and y == H/2:
  K.append(1)
else:
  K.append(0)
print(K[0],K[1])

Fixed submission:
W,H,x,y = map(int,input().split())
K = []
K.append((W*H)/2)
if x == W/2 and y == H/2:
  K.append(1)
else:
  K.append(0)
print(K[0],K[1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
ls = []
for i in range(N):
  s,p = input().spiit()
  p = int(p)
  ls.append([s,-p,i+1])
ls.sort()
for i in range(len(ls)):
  print(ls[2])

Fixed submission:
N = int(input())
ls = []
for i in range(N):
  s,p = input().split()
  p = int(p)
  ls.append([s,-p,i+1])
ls.sort()
for i in range(len(ls)):
  print(ls[i][2])
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = []
b = []
for i in range(M):
    x,y = map(int,input().split())
    a.append(x)
    b.append(y)
if max(a) <= min(b):
    print(min(y)-max(x)+1)
else:
    print(0)

Fixed submission:
a,b = map(int,input().split())
if a<=5:
    print(0)
elif 6<=a<=12:
    print(b//2)
else:
    print(b)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ls = [[int(x) for x in input().split()]for i in range(m)]
lst = []
ans = 0
ans_2 = 0
for i in range(m):
    a,b = ls[i][0],ls[i][1]
    for j in range(n):
        if a<=j<=b:
            lst.append(j)
        if lst(j) == m:
          break
for k in range(n):
    if (lst.count(k)) == m:
        ans_2 += 1
print(ans_2)

Fixed submission:
N,M = map(int,input().split())
k_1 = []
k_2 = []
for i in range(M):
  l,r = map(int,input().split())
  k_1.append(l)
  k_2.append(r)
if max(k_1)<=min(k_2):
  print(min(k_2)-max(k_1)+1)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
,m = map(int,input().split())
ls = [[int(x) for x in input().split()]for i in range(m)]
lst = []
ans = 0
ans_2 = 0
for i in range(m):
    a,b = ls[i][0],ls[i][1]
    for j in range(n):
        if a<=j<=b:
          lst.append(j)
for _ in range(n):
    if lst.count(_) == m:
        ans += 1
print(ans)

Fixed submission:
N,M = map(int,input().split())
k_1 = []
k_2 = []
for i in range(M):
  l,r = map(int,input().split())
  k_1.append(l)
  k_2.append(r)
if max(k_1)<=min(k_2):
  print(min(k_2)-max(k_1)+1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
from collections import deque
N = int(input())
g = [[] for i in range(N)]
for i in range(N-1):
  u,v,w = map(int,input().split())
  u -= 1
  v -= 1
  g[u].append([v,w])
  g[v].append([u,w])
q = deque([])
ans = [-1] * N
q.append(0)
ans[0] = 0
while len(q) > 0:
  e = q.popleft()
  for i in g[e]:
    if ans[i[0]] > -1:
      continue
    ans[i[0]] += i[1]
    ans[i[0]] = ans[i[0]] % 2
    q.append(i[0])
for i in range(len(ans)):
  if ans[i]%2 == 1:
    print(1)
    continue
  print(0)


Fixed submission:
N,K = map(int,input().split())
S = list(input())
ans = ""
if S[K-1] == "A":
  S[K-1] = "a"
if S[K-1] == "B":
  S[K-1] = "b"
if S[K-1] == "C":
  S[K-1] = "c"
for n in S:
    ans += n
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map(int,input().split())
ans = 0
for i in range(0,N//R+1):
  for j in range(0,N//G+1):
    k = N - i*R -j*G
    if k%B == 0 and k>= 0:
      ans += 1
print(ans)

Fixed submission:
R,G,B,N = map(int,input().split())
ans = 0
for i in range(0,N//R+1):
    for j in range(0,(N - R*i)//G+1):
        k = N - R*i - G*j
        if k%B == 0:
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input(),split())
if a>c>b:
print("Yes")
elif b>c>a:
print("Yes")
else:
print("No")


Fixed submission:
a,b,c = map(int,input().split())
if a>c>b:
 print("Yes")
elif b>c>a:
 print("Yes")
else:
 print("No")
Buggy python submission (verdict: Runtime Error):
#整数の入力
a,b = int(input()split())
#コインの枚数をXとする
X = int()
X = 0
if a>=b:
X = X + a
a = a - 1
else:
  X = X + b
  b = b - 1
  
print(X)

Fixed submission:
def Y(flag):
    if flag:
        print('YES')
    else:
        print('NO')
 
def y(flag):
    if flag:
        print('Yes')
    else:
        print('No')
 
a,b = map(int,input().split())
l = [a,b,a-1,b-1]
l = sorted(l)
print(l[-1] + l[-2])

Buggy python submission (verdict: Runtime Error):
input(int(A,B))
int(X)
X = 0
if(A>=B)
X = X + A
A = A - 1
else(B>A)
X = X + B
B = B - 1
print(X)

Fixed submission:
def Y(flag):
    if flag:
        print('YES')
    else:
        print('NO')
 
def y(flag):
    if flag:
        print('Yes')
    else:
        print('No')
 
a,b = map(int,input().split())
l = [a,b,a-1,b-1]
l = sorted(l)
print(l[-1] + l[-2])
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
P = S.replace("B","")
if N%2 == 1:
  k = N//2+1
else:
  k = N//2
if len(P)>k:
  print("Yes")
else:
  print("No")

Fixed submission:
A,B,C = map(int,input().split())
if A == B == C:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
b = input()
if b="A":
  print("T")
elif b="C":
  print("G")
elif b="G":
  print("C")
else:
  print("A")

Fixed submission:
b = input()
if b=="A":
  print("T")
elif b=="C":
  print("G")
elif b=="G":
  print("C")
else:
  print("A")
Buggy python submission (verdict: Runtime Error):
S = input()
mode = 0
now = 0
k = []
for i in range(len(S)):
    if str(S[i]) == "A" or str(S[i]) == "T" or str(S[i]) == "G" or str(S[i]) == "C":
        if mode == 0:
            mode = 1
            now += 1
        else:
            now += 1
    else:
        k.append(now)
        now = 0
        mode = 0
print(max(k))

Fixed submission:
S = input()
mode = 0
now = 0
k = []
for i in range(len(S)):
    if str(S[i]) == "A" or str(S[i]) == "T" or str(S[i]) == "G" or str(S[i]) == "C":
        if mode == 0:
            mode = 1
            now += 1
        else:
            now += 1
    else:
        k.append(now)
        now = 0
        mode = 0
k.append(now)
if len(k) == 0:
    print(0)
else:
    print(max(k))

Buggy python submission (verdict: Runtime Error):
#KyoproRの競技プログラミング過去問配信
S = input()
k = []
b = ["A","C","G","T"]
a = 0
for i in range(len(S)):
    #len(S)の間roop
    #S[i]が"A" "C" "G" "T"のいずれかであるかを判定
    if S[i] in b:
        if i == len(S)-1:
            k.append(1)
            break
        else:
            for j in range(len(S)-1):
                if S[i+j] in b:
                    a += 1
                else:
                    k.append(a)
                    a = 0
                    break
if len(k) == 0:
    print(0)
else:
    print(max(k))

Fixed submission:
S = input()
mode = 0
now = 0
k = []
for i in range(len(S)):
    if str(S[i]) == "A" or str(S[i]) == "T" or str(S[i]) == "G" or str(S[i]) == "C":
        if mode == 0:
            mode = 1
            now += 1
        else:
            now += 1
    else:
        k.append(now)
        now = 0
        mode = 0
k.append(now)
if len(k) == 0:
    print(0)
else:
    print(max(k))

Buggy python submission (verdict: Runtime Error):
S = input()
k = []
b = ["A","C","G","T"]
a = 0
for i in range(len(S)):
    #len(S)の間roop
    #S[i]が"A" "C" "G" "T"のいずれかであるかを判定
    if S[i] in b:
        if i == len(S)-1:
            k.append(1)
            break
        else:
            for j in range(len(S)-1):
                if S[i+j] in b:
                    a += 1
                else:
                    k.append(a)
                    a = 0
                    break
print(max(k))

Fixed submission:
S = input()
mode = 0
now = 0
k = []
for i in range(len(S)):
    if str(S[i]) == "A" or str(S[i]) == "T" or str(S[i]) == "G" or str(S[i]) == "C":
        if mode == 0:
            mode = 1
            now += 1
        else:
            now += 1
    else:
        k.append(now)
        now = 0
        mode = 0
k.append(now)
if len(k) == 0:
    print(0)
else:
    print(max(k))
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
if A*C =<B:
  print("C")
else:
  print(B % A)

Fixed submission:
A,B,C = map(int,input().split())
if (A * C) <=B:
  print(C)
else:
  print(B // A)
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
L = 0
ans = 0
for i in reversed(1,100):
  if A%i == 0:
    if B%i == 0:
      L += 1
    else:
      L += 0
  else:
    L += 0
  if L == K:
    ans = i
    break
print(ans)


Fixed submission:
A,B,K = map(int,input().split())
L = 0
ans = 0
for i in reversed(range(1,2000)):
  if A%i == 0:
    if B%i == 0:
      L += 1
    else:
      L += 0
  else:
    L += 0
  if L == K:
    ans = i
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = []
S = []
for i in range(N):
  A.append(list(map(int,input().split())))
for i in range(1,K):
  S.append(A[i])
s_count = [x for x in S if S.count(x) == N]
  print(len(S_count))

Fixed submission:
N,M = map(int,input().split())
A = [0]*M
ans = 0
for i in range(N):
  k = list(map(int,input().split()))
  for j in range(1,len(k)):
    A[k[j]-1] += 1
for i in range(len(A)):
  if A[i] == N:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
now = A[0]
for i in range(1,N):
    now = math.gcd(A[i],now)
print(now)

Fixed submission:
import math
N = int(input())
A = list(map(int,input().split()))
now = A[0]
for i in range(1,N):
    now = math.gcd(A[i],now)
print(now)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
if N>=2*K-1:
  print("YES")
else:
  print("NO")

Fixed submission:
n,k = map(int,input().split())
if n>=2*k-1:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
if N>=2K-1:
  print("YES")
else:
  print("NO")

Fixed submission:
n,k = map(int,input().split())
if n>=2*k-1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
X = int(input())
if X = 3:
  print("YES")
elif X = 5:
  print("YES")
elif X = 7:
  print("YES")
else:
  print("NO")

Fixed submission:
X = int(input())
if X == 3:
  print("YES")
elif X == 5:
  print("YES")
elif X == 7:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
l=map(int,input().split())
x=l[0]
y=l[1]
print(x+y/2)

Fixed submission:
X,Y = map(int,input().split())
K =int((X+(0.5*Y)))
print(K)
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
A = list(map(int,input().split()))
ans = 0
for i in range(N):
  if A[i] > x :
    print(ans)
    break
  else:
    x -= A[i]
    if i == N-1:
      print(N-1)
      break

Fixed submission:
N,x = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
ans = 0
for i in range(N):
  if A[i] <= x:
    if i == N-1:
      if x == A[i]:
        ans += 1
    else:
      x -= A[i]
      ans += 1
  else:
    break
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ls = []
w = []
for i in range(N):
  ls.append(str(input())
for j in range(1,N):
  if ls[j-1][(len(ls[j])-1):] and ls[j][(len(ls[j])-1):]
    if ls[j-1] in w:
      print("No")
    else:
      w.append(ls[j-1])
  else:
    print("No")
    break

Fixed submission:
N = int(input())
word = []
S = input()
word.append(S)
flag = 0
for i in range(N-1):
  S = input()
  if S[0] == word[i][-1]:
    if S not in word:
      word.append(S)
    else:
      print("No")
      flag +=1
      break
  else:
    print("No")
    flag += 1
    break
if flag == 0:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
K =int(input())
odd_num = (k-1)//2 +1
even_num = k//2
print((odd_num)*(even_num))

Fixed submission:
k =int(input())
odd_num = (k-1)//2 +1
even_num = k//2
print((odd_num)*(even_num))
Buggy python submission (verdict: Runtime Error):
N = int(input())
k = []
ans = 0
ans_2 = 0
for i in range(1,200):
  k.append(i)
for i in range(N):
  for j in range(N):
    if i%k[i] == 0:
      if ans == 8:
        ans_2 += 1
        break
      else:
        ans += 1
print(ans_2)

Fixed submission:
N = int(input())
now = 0
ans = 0
for i in range(1,N+1):
    if i%2 == 0:
        continue
    else:
        for j in range(1,i+1):
            if i%j == 0:
                now += 1
        if now == 8:
            ans += 1
        now = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
flag = 0
flag_of_flag = 0
now = 0
komoji = 0
k = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if S[0] == "A":
  flag += 1
for i in range(2,len(S)-1):
  if S[i] == "C":
    now += 1
  elif S[i] in k:
    komoji += 1
if now == 1:
  flag += 1
if S[1] in k and S[len(S)-2] in k and S[len(S)-1] in k:
  komoji += 3
if flag == 2:
  if komoji == len(S)-2:
    print("AC")
  else:
    print("WA")
else:
  print("WA")


Fixed submission:
R = int(input())
if R<1200:
  print("ABC")
elif R<2800:
  print("ARC")
else:
  print("AGC")
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N%2 = 0:
  print(N)
else:
  print(2*N)

Fixed submission:
N = int(input())
if N%2 == 0:
    print(N)
else:
    print(2*N)
Buggy python submission (verdict: Runtime Error):
S = str(input())

m = S.count("+")
n = S.conut("-")

print(m-n)

Fixed submission:
S = input()
ans = 0
for i in range(4):
  if S[i] == "+":
    ans +=1
  else:
    ans -=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
N = int(n)
n = list(n)
ans = 0
for i in range(len(n)):
  n[i] = int(n[i])
ans += int(n[i])
if N % ans == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
n = input()
N = int(n)
n = list(n)
ans = 0
for i in range(len(n)):
  n[i] = int(n[i])
  ans += int(n[i])
if N % ans == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
D,N = map(int,input().split())
K = (100**D)*N
if K%100 == 0:
　K = (100**D)*(N+1)
print(K)

Fixed submission:
D,N = map(int,input().split())
K = (100**D)*N
if N%100 == 0:
  K = (100**D)*(N+1)
print(K)
Buggy python submission (verdict: Runtime Error):
N = int(input())
now = 0
ans = 0
for i in range(1,N+1):
    if i%2 == 0:
        continue
    else:
        for j in range(1,i+1):
            if i%j == 0:
                now += 1
        if now == 8:
            ans += 1
        now = 0
print(ans)

Fixed submission:
a,b = map(int,input().split())
x = 1
y = 3
for i in range(10**5):
    if x-a == y-b:
        print(x-a)
        break
    else:
        x += i+2
        y += i+3