Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for d in len(days):
  if S == days[d]:
    break

print(6 - d)

Fixed submission:
S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(len(days)):
  if S == days[i]:
    break

print(7 - i)

Buggy python submission (verdict: Runtime Error):
S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for d in len(days):
  if S == days[d]:
    break

print(6 - d)

Fixed submission:
S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(len(days)):
  if S == days[i]:
    break

print(7 - i)

Buggy python submission (verdict: Runtime Error):
S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for d in len(days):
  if S == d:
    break

print(6 - d)

Fixed submission:
S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(len(days)):
  if S == days[i]:
    break

print(7 - i)
Buggy python submission (verdict: Runtime Error):
r = int(input())

print(int(R ** 2))

Fixed submission:
r = int(input())

print(int(r ** 2))

Buggy python submission (verdict: Runtime Error):
r = int(input())

print(int(R ** 2))

Fixed submission:
r = int(input())

print(int(r ** 2))

Buggy python submission (verdict: Runtime Error):
r = int(input())

print(R ** 2)

Fixed submission:
r = int(input())

print(int(r ** 2))
Buggy python submission (verdict: Runtime Error):
N, K, Q = map(int, input().split())
A = ""
for i in range(Q):
  A += input()

res = ["No"] * N
for i in range(Q):
  seikai = A.count(A[i])
  if K - Q + seikai > 0:
    res[i - 1] = "Yes"
  
for r in res:
  print(r)

Fixed submission:
N, K, Q = map(int, input().split())
A = [0 for _ in range(N)]
for i in range(Q):
  A[int(input()) - 1] += 1

ans = []
for a in A:
  if K + a - Q > 0:
    ans.append("Yes")
  else:
    ans.append("No")
print("\n".join(ans))
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()

cnt = 0

for i in range(3)

if S[i] == T[i]:
  cnt += 1
print(cnt)

Fixed submission:
S = input()
T = input()

cnt = 0

for i in range(3):
  if S[i] == T[i]:
    cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()

if a >= 3200:
  print(S)
else:
  print("red")

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

if a >= 3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [list(input()) for _ in range(N)]

cnt = 0
for i in range(N - 1):
  s = sorted(S[i])
  for j in range(i + 1, N):
    if s == sorted(S[j]):
      cnt += 1
print(cnt)

Fixed submission:
N = int(input())
S = [input() for _ in range(N)]

for i in range(N):
  S[i] = "".join(sorted(S[i]))

ans = {}
for i in range(N):
  if S[i] in ans:
    ans[S[i]] += 1
  else:
    ans[S[i]] = 1

cnt = 0
for a in ans:
  cnt += ans[a] * (ans[a] - 1) // 2
print(cnt)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

if A % 2 != B % 2:
  K = "IMPOSSIBLE"
elif:
  # A - K = - (B - K)
  # 2K = A + B
  K = int((A + B) / 2)
print(K)
  

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

if A % 2 != B % 2:
  K = "IMPOSSIBLE"
else:
  # B - K = - (A - K)
  # 2K = B - A
  K = int((B + A) / 2)
print(K)
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())

if R - L >= 2019:
  print(0)
else:
  ans = 2018
  for i in range(L, R):
    for j in range(i + 1, R + 1):
      ans = min(ans, (i * j) % 2019)
print(ans)

Fixed submission:
L, R = map(int, input().split())

if R - L >= 2019:
  print(0)
else:
  ans = 2018
  for i in range(L, R):
    for j in range(i + 1, R + 1):
      ans = min(ans, (i * j) % 2019)
  print(ans)

Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())

if R - L > 2019:
  print(0)
else:
  ans = 2018
  for i in range(L, R):
    for j in range(i + 1, R + 1):
      ans = min(ans, (i * j) % 2019)
print(ans)

Fixed submission:
L, R = map(int, input().split())

if R - L >= 2019:
  print(0)
else:
  ans = 2018
  for i in range(L, R):
    for j in range(i + 1, R + 1):
      ans = min(ans, (i * j) % 2019)
  print(ans)
Buggy python submission (verdict: Runtime Error):
X, A = map(int, input().split())

if X < A:
  print(0)
else:
  pfint(10)

Fixed submission:
X, A = map(int, input().split())

if X < A:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
mod = 10**9+7
DP = [0] * (N + 2)
DP[0] = 1
for i in range(0, N):
  if i in A:
    continue
  if not i + 1 in A:
    DP[i + 1] += DP[i]
  if not i + 2 in A:
    DP[i + 2] += DP[i]

print(DP[N]%mod)

Fixed submission:
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]

ans = [0 for i in range(N + 1)]
ans[0] = 1

ok = sorted(set(i for i in range(1, N + 1)) - set(A))

for i in ok:
  if i == 1:
    ans[i] = 1
  else:
    ans[i] = ans[i - 2] + ans[i - 1]
print(ans[-1]%(10**9+7))
Buggy python submission (verdict: Runtime Error):
A, P = map(int, input())

print(int((A*3+ P) //2))

Fixed submission:
A, P = map(int, input().split())

print(int((A*3+ P) //2))
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

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

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

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

for i in range(0, T+0.5, A):
  cnt += B
print(cnt)

Fixed submission:
A, B, T = map(int, input().split())
cnt = 0

for i in range(A, T+1, A):
  cnt += B
print(cnt)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
x = 0

if A - B > 1:
  x = 2A - 1
elif B - A > 1:
  x = 2B - 1
else:
  x = A + B

print(x)

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

if A - B > 1:
  x = 2 * A - 1
elif B - A > 1:
  x = 2 * B - 1
else:
  x = A + B

print(x)

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

if A - B > 1:
  x = 2A - 1
elif B - A > 1:
  x = 2B - 1
else:
  x = A + B

print(x)

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

if A - B > 1:
  x = 2 * A - 1
elif B - A > 1:
  x = 2 * B - 1
else:
  x = A + B

print(x)

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

if A - B > 1:
  x = 2A - 1
elif B - A > 1:
  x = 2B - 1
else:
 S = A + B

print(x)

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

if A - B > 1:
  x = 2 * A - 1
elif B - A > 1:
  x = 2 * B - 1
else:
  x = A + B

print(x)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
for i in range(Q):
  l, r = map(int, input().split())
  print(S[l - 1 : r].count("AC"))

Fixed submission:
N, Q = map(int, input().split())
S = input()
A = [0] * (N + 1)
for i in range(1, N):
  if S[i - 1] == "A" and S[i] == "C":
    A[i + 1] = A[i] + 1
  else:
    A[i + 1] = A[i]
for i in range(Q):
  l, r = map(int, input().split())
  print(A[r] - A[l])
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().sptit())

print(X + Y//2)


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

print(X + Y//2)
Buggy python submission (verdict: Runtime Error):
S = input()
n = 0

for s in S:
  if s == "+"
    n += 1
  else:
    n -= 1

print(n)

Fixed submission:
S = input()
n = 0

for s in S:
  if s == "+":
    n += 1
  else:
    n -= 1

print(n)

Buggy python submission (verdict: Runtime Error):
S = input()
n = 0

for s in S:
  if S == "+"
    n += 1
  else:
    n -= 1

print(n)

Fixed submission:
S = input()
n = 0

for s in S:
  if s == "+":
    n += 1
  else:
    n -= 1

print(n)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
ans = []
for i in range(A, min(A + K, B)):
  ans.append(i)

for i in range(max(ans[-1] + 1, B - K + 1), B + 1):
  ans.append(i)

for a in ans:
  print(a)

Fixed submission:
A, B, K = map(int, input().split())
ans = []

if B + 1 - A < 2 * K:
  ans = [i for i in range(A, B + 1)]
else:
  ans = [i for i in range(A, A + K)] + [i for i in range(B + 1 - K, B + 1)]
for a in ans:
  print(a)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
M = int(input())
T = [input() for i in range(M)]
ans = 0

for i in list(set(X)):
  tmp = S.count(i) - T.count(i)
  if ans < tmp:
    ans = tmp
print(ans)

Fixed submission:
N = int(input())
S = [input() for i in range(N)]
M = int(input())
T = [input() for i in range(M)]
ans = 0

for i in list(set(S)):
  tmp = S.count(i) - T.count(i)
  if ans < tmp:
    ans = tmp
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input)
print(N//3)

Fixed submission:
N = int(input())
print(N//3)
Buggy python submission (verdict: Runtime Error):
N = int(input)
A = int(input)

if N%500 <= A:
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
A = int(input())

if N%500 <= A:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]
 
s = []
cnt = 0
n = 1
f = False
while cnt <= N:
  s.append(n)
  cnt += 1
  n = A[n - 1]
  if n == 2:
    f = True
    break
  elif n in s:
    break
print(cnt if f else -1)

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]

cnt = 0
n = 1
f = False
while cnt <= N:
  cnt += 1
  n = A[n - 1]
  if n == 2:
    f = True
    break
print(cnt if f else -1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]
 
s = []
cnt = 0
n = 1
f = False
while cnt <= N:
  s.append(n)
  cnt += 1
  n = A[n - 1]
  if n == 2:
    f = True
    break
  elif s.count(n) != 0:
    break
print(cnt if f else -1)

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]

cnt = 0
n = 1
f = False
while cnt <= N:
  cnt += 1
  n = A[n - 1]
  if n == 2:
    f = True
    break
print(cnt if f else -1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]
 
s = []
cnt = 0
n = 1
f = False
while True:
  s.append(n)
  cnt += 1
  n = A[n - 1]
  if n == 2:
    f = True
    break
  elif s.count(n) != 0:
    break
print(cnt if f else -1)

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]

cnt = 0
n = 1
f = False
while cnt <= N:
  cnt += 1
  n = A[n - 1]
  if n == 2:
    f = True
    break
print(cnt if f else -1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]
s = []
cnt = 0
n = 1
f = False
while True:
  cnt += 1
  s.append(n)
  if A[n - 1] == 2:
    f = True
    break
  elif s.count(A[n - 1]) == 1:
    break
  n = A[n - 1]
print(cnt if f else -1)


Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]

cnt = 0
n = 1
f = False
while cnt <= N:
  cnt += 1
  n = A[n - 1]
  if n == 2:
    f = True
    break
print(cnt if f else -1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(a) for a in input().split()]
ans = 1
for i in A:
    ans *= i
if ans <= 10**18:
    print(ans)
else:
    print(-1)


Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]
if min(A) == 0:
    print(0)
else:
    ans = 1
    M = 10**18
    for i in A:
        ans *= i
        if ans > M:
            print(-1)
            break
    else:
        print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 1
for i in range(N):
    ans *= int(input())
if ans <= 10**18:
    print(ans)
else:
    print(-1)

Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]
if min(A) == 0:
    print(0)
else:
    ans = 1
    M = 10**18
    for i in A:
        ans *= i
        if ans > M:
            print(-1)
            break
    else:
        print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
for i, j in enumerate(s):
	if i % 2 == 0 and j == 'L':
		print('No')
        return
    elif i % 2 == 1 and j == 'R':
		print('No')
        return
print('Yes')

Fixed submission:
s = input()
for i, j in enumerate(s):
    if i % 2 == 0 and j == 'L':
        print('No')
        break
    elif i % 2 == 1 and j == 'R':
        print('No')
        break
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
from math import floor

A, B, N = map(int, input().split())

ans = 0
for x in range(1,N+1):
    tmp = floor(A*x/B)-A*floor(x/B)
    if tmp > ans:
        ans = tmp

print(ans)


Fixed submission:
from math import floor

A, B, N = map(int, input().split())

def f(x):
    return floor(A*x/B)-A*floor(x/B)

print(f(min(B-1,N)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

for i in(range(1,N+1)):
    print(A.count(i))


Fixed submission:
N = int(input())
A = list(map(int,input().split()))

from collections import Counter

cnt = Counter(A)

for i in(range(1,N+1)):
    print(cnt[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

for i in(range(1,N+1)):
    print(A.count(i))    


Fixed submission:
N = int(input())
A = list(map(int,input().split()))

from collections import Counter

cnt = Counter(A)

for i in(range(1,N+1)):
    print(cnt[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

ans = 0

index_r = [i for i, x in enumerate(S) if x =='R']
index_g = [i for i, x in enumerate(S) if x =='G']
index_b = [i for i, x in enumerate(S) if x =='B']

for r in index_r:
    for g in index_g:
        for b in index_b:
            idxs = sorted([r,g,b])
            if 2*idxs[1] != idxs[0]+idxs[2]:
                ans +=1

print(ans)


Fixed submission:
N = int(input())
S = input()

ans = S.count('R')*S.count('G')*S.count('B')

for i in range(N):
    for j in range(N):
        if i+2*j < N:
            if len(set([S[i],S[i+j],S[i+2*j]]))==3:
                ans -=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N = int(input())
S = input()

ans = 0

for i in range(1,N-1):
    for j in range(i+1,N):
        for k in range(j+1,N+1):
            if (2*j != k+i)&(len(set([S[i-1],S[j-1],S[k-1]]))==3):
                ans +=1

print(ans)


Fixed submission:
N = int(input())
S = input()

ans = S.count('R')*S.count('G')*S.count('B')

for i in range(N):
    for j in range(N):
        if i+2*j < N:
            if len(set([S[i],S[i+j],S[i+2*j]]))==3:
                ans -=1
print(ans)
Buggy python submission (verdict: Runtime Error):
X = int(input())
ans = 0
ans += X//500 * 1000
x = x % 500
ans += X // 500 * 5

print(ans)

Fixed submission:
X = int(input())
ans = 0
ans += X//500 * 1000
X = X % 500
ans += X // 5 * 5

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

ans = N*(N-1)/2 + M(M-1)/2

print(ans)

Fixed submission:
N, M = map(int, input().split())

ans = N*(N-1)/2 + M*(M-1)/2

print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

def comb2(n):
    return n * (n - 1) // 2

c = Counter(A)
ans = 0
for m in c.values():
    if m >= 2:
        ans +=comb2(m)

for a in A:
    print(ans - A.count(a)+1)


Fixed submission:
import math
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

def comb2(n):
    return n * (n - 1) // 2

c = Counter(A)
ans = 0
for m in c.values():
    if m >= 2:
        ans +=comb2(m)

for i in range(N):
    print(ans - c[A[i]] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

from itertools import combinations

for k in range(N):
  S = A[:k]+A[k+1:]
  ans = 0
  for c in combinations(S,2):
    if c[0]==c[1]:
      ans +=1
  print(ans)

Fixed submission:
import math
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

def comb2(n):
    return n * (n - 1) // 2

c = Counter(A)
ans = 0
for m in c.values():
    if m >= 2:
        ans +=comb2(m)

for i in range(N):
    print(ans - c[A[i]] + 1)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())

ans = 0 
num = 0
while True:
  ans += A
  num += A
  if num >= N:
    ans -= num-N
    break
  num += B
  if num >= N:
    break
    
print(ans)

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

ans = N//(A+B)*A
rem = N % (A+B)

ans += min(rem, A)
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

for i in range(1,1010):
  if (i*0.08//A==1)&(i*0.1//B==1):
    ans = i
    break
    
print(ans)

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

for i in range(1,1010):
  if (int(i*0.08)==A)&(int(i*0.1)==B):
    print(i)
    break
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = input().split()
P = [int(p) for p in P]

import numpy as np

E = (np.array(P)+1)/2

ans = 0.0
for i in range(K,N+1):
  if sum(E[i-K:i])> ans:
    ans = sum(E[i-K:i])
print(float(ans))

Fixed submission:
N, K = map(int, input().split())
P = input().split()
P = [int(p) for p in P]

import numpy as np

E = (np.array(P)+1)/2
E = np.cumsum(E)  

ans = E[K-1]
for i in range(0,N-K):
  ans = max(ans, E[i+K]-E[i])
print(float(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = input().split()
P = [int(p) for p in P]

E = [p*(p+1)/2/p for p in P]

ans = 0.0
for i in range(K,N+1):
  if sum(E[i-K:i])> ans:
    ans = sum(E[i-K:i])
print(float(ans))

Fixed submission:
N, K = map(int, input().split())
P = input().split()
P = [int(p) for p in P]

import numpy as np

E = (np.array(P)+1)/2
E = np.cumsum(E)  

ans = E[K-1]
for i in range(0,N-K):
  ans = max(ans, E[i+K]-E[i])
print(float(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = input().split()
P = [int(p) for p in P]

E = []
for p in P:
  E.append(p*(p+1)/2/p)
  
ans = 0.0
for i in range(K,N+1):
  if sum(E[i-K:i])> ans:
    ans = sum(E[i-K:i])
print(float(ans))

Fixed submission:
N, K = map(int, input().split())
P = input().split()
P = [int(p) for p in P]

import numpy as np

E = (np.array(P)+1)/2
E = np.cumsum(E)  

ans = E[K-1]
for i in range(0,N-K):
  ans = max(ans, E[i+K]-E[i])
print(float(ans))
Buggy python submission (verdict: Time Limit Exceeded):

import numpy as np

N = int(input())
P = input().split()
P = np.array([int(p) for p in P])

ans = N
for i, p in enumerate(P):
  ans -= int(((P[:i+1]<p).sum()>0))
print(ans)

Fixed submission:
N = int(input())
P = input().split()
P = [int(p) for p in P]

ans = N
min_p = P[0]
for p in P[1:N]:
  if min_p > p:
    min_p = p
  else:
    ans -=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = input().split()
P = [int(p) for p in P]

ans = N
for i, p in enumerate(P):
  for j in range(0,i+1):
    if P[i] > P[j]:
      ans -=1
      break
print(ans)

Fixed submission:
N = int(input())
P = input().split()
P = [int(p) for p in P]

ans = N
min_p = P[0]
for p in P[1:N]:
  if min_p > p:
    min_p = p
  else:
    ans -=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N,K,S = map(int, input().split())

if S == 10**9:
  [S]*K +[1]*(N-K)
else:
  ans = [S]*K +[S+1]*(N-K)

ans_txt=''

for s in ans:
  ans_txt += str(s)+' '

print(ans_txt)

Fixed submission:
N,K,S = map(int, input().split())

if S == 10**9:
  ans = [S]*K +[1]*(N-K)
else:
  ans = [S]*K +[S+1]*(N-K)

ans_txt=''

for s in ans:
  ans_txt += str(s)+' '

print(ans_txt)
Buggy python submission (verdict: Runtime Error):
n,k,m = map(int, input().split())
a = input().split()
a = [int(_a) for _a in a]
ans = m*n - sum(a)
if ans >= k:
  ans = -1
print(ans)

Fixed submission:
C = input()

ans = ''
for i in range(26):
  if chr(ord('a') + i) == C:
    ans = chr(ord('a') + i + 1)
    
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
num_ac = 0
num_wa = 0
tmp_num_wa = 0
answerd = []

for i in range(m):
  p,s = input().split()
  if p in answerd:
    continue
  if s == 'WA':
    tmp_num_wa += 1
  if s == 'AC':
    num_ac += 1
    num_wa += tmp_num_wa
    tmp_num_wa = 0
    answerd.append(_p)
    
print(num_ac, num_wa)

Fixed submission:
n,m = map(int, input().split())
ac = [0]*n
wa = [0]*n

for i in range(m):
  p,s = input().split()
  p = int(p)-1
  if s == 'AC':
     ac[p] = 1
  elif s == 'WA':
    if ac[p] == 0:
      wa[p] += 1

num_ac = 0
num_wc = 0

for a, w in zip(ac,wa):
  num_ac += a
  if a > 0:
    num_wc += w  
print(num_ac,num_wc)
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

if k >= a:
  _a = 0
  if k-a >= b:
    _b = 0
  else:
    _b = b-(k-a)
else:
  _a = a - k
     
print('{} {}'.format(_a,_b))

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

if k >= a:
  _a = 0
  if k-a >= b:
    _b = 0
  else:
    _b = b-(k-a)
else:
  _a = a - k
  _b = b
     
print('{} {}'.format(_a,_b))

Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())

for i in range(0,k):
  if a >= 1:
    a -= 1
  elif b >=1:
    b -= 1
    
print('{} {}'.format(a,b))

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

if k >= a:
  _a = 0
  if k-a >= b:
    _b = 0
  else:
    _b = b-(k-a)
else:
  _a = a - k
  _b = b
     
print('{} {}'.format(_a,_b))
Buggy python submission (verdict: Time Limit Exceeded):
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}



def main():
    N, M = map(int, input().split())
    unf = UnionFind(N)
    for i in range(M):
        A, B = map(int, input().split())
        if not unf.same(A-1, B-1):
            unf.union(A-1, B-1)
    
    groups = unf.all_group_members()

    sizes = []
    for k, i in groups.items():
        sizes.append(len(groups[k]))
    
    group_nums = len(sizes)
    print(max(sizes))
    
if __name__ == '__main__':
    main()

Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}



def main():
    N, M = map(int, input().split())
    unf = UnionFind(N)
    for i in range(M):
        A, B = map(int, input().split())
        if not unf.same(A-1, B-1):
            unf.union(A-1, B-1)

    print(-min(unf.parents))

    
if __name__ == '__main__':
    main()