Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()
amari = [0]*2019
ans = 0
amari[0] = 1
A = 0
for i in range(len(S)):
    A += pow(10, i, 2019)*int(S[S-1-i:])
    amari[A % 2019] += 1
for i in amari:
    if i >= 2:
        ans += i*(i-1)/2
print(ans)
        
    

Fixed submission:
S = input()
amari = [0]*2019
ans = 0
amari[0] = 1
A = 0
for i in range(len(S)):
    A += pow(10, i, 2019)*(int(S[len(S)-1-i]))
    amari[A % 2019] += 1
for i in amari:
    if i >= 2:
        ans += i*(i-1)/2
print(int(ans))

Buggy python submission (verdict: Runtime Error):
S = input()
amari = [0]*2019
ans = 0
for i in range(len(S)):
    amari[int(S[len(S)-1-i:]) % 2019] += 1
for i in amari:
    if i >= 2:
        ans += i(i-1)/2
print(ans)
    

Fixed submission:
S = input()
amari = [0]*2019
ans = 0
amari[0] = 1
A = 0
for i in range(len(S)):
    A += pow(10, i, 2019)*(int(S[len(S)-1-i]))
    amari[A % 2019] += 1
for i in amari:
    if i >= 2:
        ans += i*(i-1)/2
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
s = len(S)
ans = 0
for i in range(0, s-3):
  for j in range(i+3, s+1):
    if int(S[i:j]) % 2019 == 0:
      ans += 1
print(ans)
     


Fixed submission:
S = input()
amari = [0]*2019
ans = 0
amari[0] = 1
A = 0
for i in range(len(S)):
    A += pow(10, i, 2019)*(int(S[len(S)-1-i]))
    amari[A % 2019] += 1
for i in amari:
    if i >= 2:
        ans += i*(i-1)/2
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
s = len(S)
a = []
ans = 0
for i in range(0, s-3):
  for j in range(i+3, s+1):
    if int(S[i:j]) % 3 == 0:
      a.append([i,j])
for t in range(len(a)):
  i, j = a[t]
  if int(S[i:j]) % 673 == 0:
    ans += 1
print(ans)

Fixed submission:
S = input()
amari = [0]*2019
ans = 0
amari[0] = 1
A = 0
for i in range(len(S)):
    A += pow(10, i, 2019)*(int(S[len(S)-1-i]))
    amari[A % 2019] += 1
for i in amari:
    if i >= 2:
        ans += i*(i-1)/2
print(int(ans))

Buggy python submission (verdict: Runtime Error):
S = input()
s = len(S)
a = []
ans = 0
for i in range(s):
  for j in range(i+3, s):
    if int(S[i:j]) % 3 == 0:
      a.append([i,j])
for t in range(len(a)):
  i, j = a[t]
  if a[i:j] % 673 == 0:
    ans += 1
print(ans)
  
      

Fixed submission:
S = input()
amari = [0]*2019
ans = 0
amari[0] = 1
A = 0
for i in range(len(S)):
    A += pow(10, i, 2019)*(int(S[len(S)-1-i]))
    amari[A % 2019] += 1
for i in amari:
    if i >= 2:
        ans += i*(i-1)/2
print(int(ans))
Buggy python submission (verdict: Runtime Error):
import math
R = int(input())
ans = floot(math.pi*R*2)
print(ans)

Fixed submission:
R = int(input())
ans = float(2*R*3.1416)
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = int(input().split())
A = list(map(int, input().split()))
S = sum(A)
ans = -1
if N >= S:
  ans = N-S
print (ans)

Fixed submission:
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
S = sum(A)
ans = -1
if N >= S:
  ans = N-S
print (ans)

Buggy python submission (verdict: Runtime Error):
N, M = int(input())
A = list(map(int, input().split()))
S = sum(A)
ans = -1
if N >= S:
  ans = N-S
print (ans)
  

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

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0]*N
for i in range(N-1):
  ans[A[i]-1] += 1
for j in range(N):
  print(ans[j])
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
r = S.count("R")
g = S.count("G")
b = S.count("B")
 
ans = r*g*b
for i in range(N-2):
  for j in range(i+1, N-1):
    k = 2*j-i
    if k <= N-1:
      if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
        ans -= 1
 
print(ans

Fixed submission:
N = int(input())
A = list(input())
ans = A.count("R")*A.count("G")*A.count("B")
for i in range(N-2):
  for j in range(i+1, N-1):
    k = 2*j-i
    if k<N and A[k] != A[i] and A[k] != A[j] and A[i] != A[j]:
      ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
r = S.count("R")
g = S.count("G")
b = S.count("B")
 
ans = r*g*b
for i in range(N):
  for j in range(i+1, N):
    k = 2*j-i
    if k <= N-1:
      if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
        ans -= 1
 
print(ans

Fixed submission:
N = int(input())
A = list(input())
ans = A.count("R")*A.count("G")*A.count("B")
for i in range(N-2):
  for j in range(i+1, N-1):
    k = 2*j-i
    if k<N and A[k] != A[i] and A[k] != A[j] and A[i] != A[j]:
      ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())
r = S.count("R")
g = S.count("G")
b = S.count("B")

ans = r*g*b
for i in range(N):
  for j in range(N):
    k = 2*j-i
    if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
      ans -= 1

print(ans)


Fixed submission:
N = int(input())
A = list(input())
ans = A.count("R")*A.count("G")*A.count("B")
for i in range(N-2):
  for j in range(i+1, N-1):
    k = 2*j-i
    if k<N and A[k] != A[i] and A[k] != A[j] and A[i] != A[j]:
      ans -= 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(input())
R = []
B = []
G = []
for i in range(N):
  if A[i] == "R":
    R.append(i)
  elif A[i] == "G":
    G.append(i)
  else:
    B.append(i)
ans = 0
for i in range(len(R)):
  for j in range(len(G)):
    for k in range(len(B)):
      if (max(R[i], G[j], B[k]) + min(R[i], G[j], B[k]))/2 != (R[i]+G[j]+B[k])/3:
        ans += 1
print(ans)
        


    

Fixed submission:
N = int(input())
A = list(input())
ans = A.count("R")*A.count("G")*A.count("B")
for i in range(N-2):
  for j in range(i+1, N-1):
    k = 2*j-i
    if k<N and A[k] != A[i] and A[k] != A[j] and A[i] != A[j]:
      ans -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(input())
R = []
B = []
G = []
for i in range(N):
  if A[i] == "R":
    R.append(i)
  elif A[i] == "G":
    G.append(i)
  else:
    B.append(i)
ans = 0
for i in range(len(R)):
  for j in range(len(G)):
    for k in range(len(B)):
      if (max(R[i], G[j], B[k]) + min(R[i], G[j], B[k]))/2 != (R[i], G[j], B[k])/3:
        ans += 1
print(ans)
        


    

Fixed submission:
N = int(input())
A = list(input())
ans = A.count("R")*A.count("G")*A.count("B")
for i in range(N-2):
  for j in range(i+1, N-1):
    k = 2*j-i
    if k<N and A[k] != A[i] and A[k] != A[j] and A[i] != A[j]:
      ans -= 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
mod = 10**9+7
ans = [0]*(K+1)
s = 0
for i in range(K, 0, -1):
    ans[i] = pow(K//i, N)%mod
    for j in range(2*i, K+1, i):
        ans[i] -= ans[j]
    s += ans[i]*i%mod
print(s%mod)


Fixed submission:
N, K = map(int, input().split())
li = [0]*(K+1)

out = 0
mod = 10**9+7

for i in range(K, 0, -1):
  li[i] = pow(K//i, N, mod) 
  for j in range(i*2, K+1, i):
    li[i] -= li[j]
  out += li[i] * i
print(out%mod)
Buggy python submission (verdict: Runtime Error):
K, N = map(int, input().split())
L = list(map(int, input().split()))
sa = [L[i+1]-L[i] for i in range(N-1)]
sa += K-L[N-1]+L[0]
ans = K-max(sa)
print(ans)

Fixed submission:
K, N = list(map(int, input().split()))
L = list(map(int, input().split()))
sa = [L[i+1]-L[i] for i in range(N-1)]
sa += [K-L[N-1]+L[0]]
ans = K-max(sa)
print(ans)
Buggy python submission (verdict: Runtime Error):
A = []
for _ in range(3):
  A　+= list(map(int,input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]
C = [0]*9
for i in B:
  if i in A:
    x = A.index(i)
    C[x] = 1
if C[0]*C[1]*C[2] == 1 or C[3]*C[4]*C[5]==1 or C[6]*C[7]*C[8] ==1 or C[0]*C[3]*C[6] ==1 or C[1]*C[4]*C[7]==1 or C[2]*C[5]*C[8] ==1 or C[0]*C[4]*C[8] ==1 or C[2]*C[4]*C[6] ==1:
  print("Yes")
else:
  print("No")
  

Fixed submission:
A = []
for _ in range(3):
  A += list(map(int,input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]
C = [0]*9
for i in B:
  if i in A:
    x = A.index(i)
    C[x] = 1
if C[0]*C[1]*C[2] == 1 or C[3]*C[4]*C[5]==1 or C[6]*C[7]*C[8] ==1 or C[0]*C[3]*C[6] ==1 or C[1]*C[4]*C[7]==1 or C[2]*C[5]*C[8] ==1 or C[0]*C[4]*C[8] ==1 or C[2]*C[4]*C[6] ==1:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
for _ in range(3):
  A += list(map(int,input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]
C = [0]*9
for i in B:
  if i in A:
    x = A.index(i)
    C[x] = 1
if C[0]*C[1]*C[2] == 1 or C[3]*C[4]*C[5]==1 or C[6]*C[7]*C[8] ==1 or C[0]*C[3]*C[6] ==1 or C[1]*C[4]*C[7]==1 or C[2]*C[5]*C[8] ==1 or C[0]*C[4]*C[8] ==1 or C[2]*C[4]*C[6] ==1:
  print("Yes")
else:
  print("No")
  

Fixed submission:
A = []
for _ in range(3):
  A += list(map(int,input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]
C = [0]*9
for i in B:
  if i in A:
    x = A.index(i)
    C[x] = 1
if C[0]*C[1]*C[2] == 1 or C[3]*C[4]*C[5]==1 or C[6]*C[7]*C[8] ==1 or C[0]*C[3]*C[6] ==1 or C[1]*C[4]*C[7]==1 or C[2]*C[5]*C[8] ==1 or C[0]*C[4]*C[8] ==1 or C[2]*C[4]*C[6] ==1:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
for _ in range(3):
  A　+= list(map(int,input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]
C = [0]*9
for i in B:
  if i in A:
    x = A.index(i)
    C[x] = 1
if C[0]*C[1]*C[2] == 1 or C[3]*C[4]*C[5]==1 or C[6]*C[7]*C[8] ==1 or C[0]*C[3]*C[6] ==1 or C[1]*C[4]*C[7]==1 or C[2]*C[5]*C[8] ==1 or C[0]*C[4]*C[8] ==1 or C[2]*C[4]*C[6] ==1:
  print("Yes")
else:
  print("No")
  


Fixed submission:
A = []
for _ in range(3):
  A += list(map(int,input().split()))
N = int(input())
B = [int(input()) for _ in range(N)]
C = [0]*9
for i in B:
  if i in A:
    x = A.index(i)
    C[x] = 1
if C[0]*C[1]*C[2] == 1 or C[3]*C[4]*C[5]==1 or C[6]*C[7]*C[8] ==1 or C[0]*C[3]*C[6] ==1 or C[1]*C[4]*C[7]==1 or C[2]*C[5]*C[8] ==1 or C[0]*C[4]*C[8] ==1 or C[2]*C[4]*C[6] ==1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [input() for i in range(N)]
B = list(set(A))
C = [0]*len(B)
for i in range(len(B)):
  C[i] = A.count(B[i])
D = max(C)
for s in sorted([B[i] for i, x in enumerate(C) if x == D]):
    print(s)


Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [input() for i in range(N)]
B = list(set(A))
C = [0]*len(B)
for i in range(len(B)):
  C[i] = A.count(B[i])
D = max(C)
for s in sorted([B[i] for i, x in enumerate(C) if x == D]):
　print(s)

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [input() for i in range(N)]
B = list(set(A))
C = [0]*len(B)
for i in range(len(B)):
  C[i] = A.count(B[i])
#ここでなんかいもよびだしている
D = max(C)
for s in sorted([B[i] for i, x in enumerate(C) if x == D]:
    print(s)

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [input() for i in range(N)]
B = list(set(A))
C = [0]*len(B)
for i in range(len(B)):
  C[i] = A.count(B[i])
D = max(C)
E = sorted([B[i] for i, x in enumerate(C) if x == D])
for i in range(len(E)):
  print(E[i])




Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
  if A[i] == min(A[:i+1]):
    ans += 1
print(ans)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
min = 10**6
for i in range(N):
  if A[i] < min:
    ans += 1
    min = A[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
A = tuple(map(int, input().split()))
B = tuple(map(int, input().split()))
X = itertools.permutations(range(1, N+1))
a = X.index(A)
b = X.index(B)
print(abs(a-b))

Fixed submission:
import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
A = [i for i in range(1, N+1)]
B = list(itertools.permutations(A))
ans = abs(B.index(P)-B.index(Q))
print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
A = [i for i in range(1, N)]
B = list(itertools.permutations(A))
ans = abs(B.find(P)-B.find(Q))
print(ans)

Fixed submission:
import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
A = [i for i in range(1, N+1)]
B = list(itertools.permutations(A))
ans = abs(B.index(P)-B.index(Q))
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
num = 1
for i in range(1,N+1):
  if A[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)


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

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
num = 1
for i in range(N:
  if a[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)


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

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
num = 1
for i in range(1,N+1):
  if a[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)


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

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
for i in range(1,N+1):
  if i in A[x+1:]:
    x = A[x+1:].index(i)
    count += 1
  else:
    break
if count != 0:
  print(N-count)
else:
  print(-1)


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

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
for i in range(1:N+1):
  if i in A:
    x = A[x+1:].index(i)
    count += 1
  else:
    break
if count != 0:
  print(count)
else:
  print(-1)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
x = -1
num = 1
for i in range(N):
  if A[i] == num:
    count += 1
    num += 1
if count != 0:
  print(N-count)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
X = int(input())
DP = [0]*100001
DP[100] = 1
DP[101] = 1
DP[102] = 1
DP[103] = 1
DP[104] = 1
DP[105] = 1

for i in range(106, 100001):
    if any(DP[i-100], DP[i-101], DP[i-102], DP[i-103], DP[i-104], DP[i-105]):
        DP[i] = 1
print(DP[W])

Fixed submission:
X = int(input())
flag = 1
if X < 100:
  flag = 0
else:
  a = X%100
  b = a%10
  c = (a-b)/10
  count = 2*c
  if 1 <= b <= 5:
    count += 1
  elif 6<= b <= 9:
    count += 2
  if X//100 < count:
    flag = 0
print(flag)

Buggy python submission (verdict: Runtime Error):
X = int(input())
flag = 1
if X < 100:
  flag = 0
else:
  a = X%100
  b = a%10
  c = (a-b)/10
  count = 2*c
  if 1 <= b <= 5:
    conut += 1
  elif 6<= b <= 9:
    count += 2
  if X//100 < count:
    flag = 0
print(flag)
      

Fixed submission:
X = int(input())
flag = 1
if X < 100:
  flag = 0
else:
  a = X%100
  b = a%10
  c = (a-b)/10
  count = 2*c
  if 1 <= b <= 5:
    count += 1
  elif 6<= b <= 9:
    count += 2
  if X//100 < count:
    flag = 0
print(flag)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B = []
for i in range(N):
    B.append(A.index(i+1)+1)
C = map(str, B)
D = " ".join(C)
print(D)
    
    

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = [0]*N
for i, j in enumerate(A):
    B[j-1] = i+1
print(*B)
Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
zahyo = [0]*N
for i in range(N):
  zahyo[i] = list(map(int, input().split()))
count = 0
for i in range(N):
  for j in range(i+1, N):
    V = 0
    for k in range(D):
      V += float((zahyo[i][k]-zahyo[j][k])**0.5)
    if V.is_integer():
      count += 1
print(count)

Fixed submission:
N, D = map(int, input().split())
zahyo = [0]*N
for i in range(N):
  zahyo[i] = list(map(int, input().split()))
count = 0
for i in range(N):
  for j in range(i+1, N):
    V = 0
    for k in range(D):
      V += (zahyo[i][k]-zahyo[j][k])**2
    if (float(V**0.5)).is_integer():
      count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
a = A[int(N/2)]
b = A[int(N/2)+1]
print(b-a)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
a = A[int(N/2)-1]
b = A[int(N/2)]
print(b-a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
a = A[int(N/2)]
b = A[int(N/2)+1]
print(b-a)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
a = A[int(N/2)-1]
b = A[int(N/2)]
print(b-a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
a = A[int(N/2)]
b = A[int(N/2)+1]
print(b-a)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
a = A[int(N/2)-1]
b = A[int(N/2)]
print(b-a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
a = A[int(N/2)]
b = A[int(n/2)+1]
print(b-a)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
a = A[int(N/2)-1]
b = A[int(N/2)]
print(b-a)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(M)]
B = {x for x in range(A[0][0], A[0][1]+1)}
for i in range(1,M):
  C = {x for x in range(A[i][0],A[i][1]+1)}
  B = B & C
ans = len(B)
print(ans)
  
  


Fixed submission:
N, M = map(int, input().split())
A = [0]*M
B = [0]*M
for i in range(M):
  A[i], B[i] = map(int, input().split())
a = max(A)
b = min(B)
if a <= b:
  print(b+1-a)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
S = list(input())
A = []
j = 0
ans = 0
while j < len(S):
  i = S[j]
  if i == "A" or i == "C" or i == "G" or i == "T":
    ans += 1
    j += 1
  else:
    A.append(ans)
    ans = 0
    j += 1
print(max(A))
    

Fixed submission:
S = list(input())
A = []
j = 0
ans = 0
while j < len(S):
  i = S[j]
  if i == "A" or i == "C" or i == "G" or i == "T":
    ans += 1
    j += 1
  else:
    A.append(ans)
    ans = 0
    j += 1
if ans > 0:
    A.append(ans)
print(max(A))
Buggy python submission (verdict: Runtime Error):
N, M  = map(int, input().split())
A = [lsit(map(int, input().split())) for _ in range(N)]
B = sorted(A, key = lambda x:x[0])
hon = 0
cost = 0
for i in range(N):
  hon += B[i][1]
  if hon >= M:
    cost += B[i][0]*(B[i][1]-(hon-M))
    break
  else:
    cost += B[i][0]*B[i][1]
print(cost)

Fixed submission:
N, M  = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]
B = sorted(A, key = lambda x:x[0])
hon = 0
cost = 0
for i in range(N):
  hon += B[i][1]
  if hon >= M:
    cost += B[i][0]*(B[i][1]-(hon-M))
    break
  else:
    cost += B[i][0]*B[i][1]
print(cost)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
S = set(range(1:M+1))
for i in range(N):
    K, *A = map(int, input().split())
    S &= set(A)
print(len(S))


Fixed submission:
N, M = map(int, input().split())
S = set(range(1,M+1))
for i in range(N):
    K, *A = map(int, input().split())
    S &= set(A)
print(len(S))
Buggy python submission (verdict: Runtime Error):
N, W = map(int, input().split())
X = [list(map(int, input().split())) for i in range(N)]
DP=[[0]*(W+1) for i in range(N+1)]
for i in range(1, W+1):
    DP[0][i] = float("-inf")
for i in range(1, N+1):
    for j in range(W+1):
        if j-X[i-1][0] >= 0:
            DP[i][j] = max(DP[i-1][j], DP[i-1][j-X[i-1][0]]+X[i-1][1])
        else:
            DP[i][j] = DP[i-1][j]
print(max(DP[N]))
                    
#最後から2行目。
#ありえないのは-INFで選ばれないように


Fixed submission:
N, W = map(int, input().split())
X = [list(map(int, input().split())) for i in range(N)]
DP=[[float("inf")]*(N*10**3+1) for i in range(N+1)]
DP[0][0] = 0
for i in range(1, N+1):
    for j in range(N*10**3+1):
        if j-X[i-1][1] >= 0:
            DP[i][j]=min(DP[i-1][j], DP[i-1][j-X[i-1][1]]+X[i-1][0])
        else:
            DP[i][j] = DP[i-1][j]
ans = 0
for i in range(N+1):
    for j in range(N*10**3+1):
        if DP[i][j] <= W:
            ans = max(ans, j)
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
flag = 1
if S[0] != "A":
  flag = 0
if S[2:-2].count("C") != 1:
  flag =0
S.remove("A")
S.remove("C")
if not(S.islower()):
  flag = 0
print("AC" if flag else "WA")

Fixed submission:
S = input()
print("AC" if "A" in S and "C" in S[2:-1] and S[1:].replace("C", "", 1).islower() else "WA")
Buggy python submission (verdict: Runtime Error):
A, B, C, K = int(input().split())
print(A-B if K % 2 == 0 else B-A)

Fixed submission:
A, B, C, K = map(int,input().split())
print(A-B if K % 2 == 0 else B-A)
Buggy python submission (verdict: Runtime Error):
N = int(input())
X = set()
for i in range(2,32):
  for j in range(2, 10):
    if pow(i,j) <= N:
      X.add(pow(i, j))
    else:
      break
print(max(X))


Fixed submission:
N = int(input())
X = set()
for i in range(1,32):
  for j in range(2, 10):
    if pow(i,j) <= N:
      X.add(pow(i, j))
    else:
      break
print(max(X))

Buggy python submission (verdict: Runtime Error):
N = int(input())
X = {}
for i in range(2,32):
  for j in range(2, 10):
    if pow(i,j) <= X:
      X.add(pow(i, j))
    else:
      break
print(max(X))

    

Fixed submission:
N = int(input())
X = set()
for i in range(1,32):
  for j in range(2, 10):
    if pow(i,j) <= N:
      X.add(pow(i, j))
    else:
      break
print(max(X))
Buggy python submission (verdict: Runtime Error):
A, B, C, X, Y = map(int, input().split())
price = [0]*(max(X, Y)+1)
prine[0] = A*X+B*Y
for i in range(1, max(X, Y)+1):
  price [i] = 2*C*i+A*max(0, X-i)+B*max(0,Y-i)
print(min(price))

Fixed submission:
A, B, C, X, Y = map(int, input().split())
price = [0]*(max(X, Y)+1)
price[0] = A*X+B*Y
for i in range(1, max(X, Y)+1):
  price [i] = 2*C*i+A*max(0, X-i)+B*max(0,Y-i)
print(min(price))
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
ans += A+B+C-min(A, min(B, C))
if (max(A, max(B, C)) + min(A, min(B, C))) % 2 != 0:
  ans += 1
  ans += (max(A, max(B, C))+1-min(A, min(B, C))) / 2
else:
  ans += (max(A, max(B, C))-min(A, min(B, C))) / 2
print(int(ans))

Fixed submission:
A, B, C = map(int, input().split())
X = sorted([A, B, C])
ans = X[2]-X[1]
if (X[2]+X[0]+X[2]-X[1]) % 2 != 0:
    ans += 1
    ans += (X[2]+1-(X[0]+X[2]-X[1])) / 2
else:
    ans += (X[2]-(X[0]+X[2]-X[1])) / 2
print(int(ans))