Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split(' ')))
Q = int(input())
BC = [list(map(int, list(input().split(' ')))) for i in range(Q)]

count = [0] * 10**5 + 5
for i in range(N):
    count[A[i]] += 1

s = sum(A)
for i in range(Q):
    s = s - BC[i][0] * count[BC[i][0]] + BC[i][1] * count[BC[i][0]]
    count[BC[i][1]] += count[BC[i][0]]
    count[BC[i][0]] = 0
    print(s)


Fixed submission:
N = int(input())
A = list(map(int, input().split(' ')))
Q = int(input())
BC = [list(map(int, list(input().split(' ')))) for i in range(Q)]

count = [0] * (10**5 + 5)
for i in range(N):
    count[A[i]] += 1

s = sum(A)
for i in range(Q):
    s = s - BC[i][0] * count[BC[i][0]] + BC[i][1] * count[BC[i][0]]
    count[BC[i][1]] += count[BC[i][0]]
    count[BC[i][0]] = 0
    print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split(' ')))
Q = int(input())
BC = [list(map(int, list(input().split(' ')))) for i in range(Q)]

count = [0] * 10**5
for i in range(N):
    count[A[i]] += 1

Fixed submission:
N = int(input())
A = list(map(int, input().split(' ')))
Q = int(input())
BC = [list(map(int, list(input().split(' ')))) for i in range(Q)]

count = [0] * (10**5 + 5)
for i in range(N):
    count[A[i]] += 1

s = sum(A)
for i in range(Q):
    s = s - BC[i][0] * count[BC[i][0]] + BC[i][1] * count[BC[i][0]]
    count[BC[i][1]] += count[BC[i][0]]
    count[BC[i][0]] = 0
    print(s)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split(' ')))
Q = int(input())
BC = [list(map(int, list(input().split(' ')))) for i in range(Q)]

count = [0] * 10**5
for i in range(N):
    count[A[i]] += 1

s = sum(A)
for i in range(Q):
    s = s - BC[i][0] * count[BC[i][0]] + BC[i][1] * count[BC[i][0]]
    count[BC[i][1]] += count[BC[i][0]]
    count[BC[i][0]] = 0
    print(s)


Fixed submission:
N = int(input())
A = list(map(int, input().split(' ')))
Q = int(input())
BC = [list(map(int, list(input().split(' ')))) for i in range(Q)]

count = [0] * (10**5 + 5)
for i in range(N):
    count[A[i]] += 1

s = sum(A)
for i in range(Q):
    s = s - BC[i][0] * count[BC[i][0]] + BC[i][1] * count[BC[i][0]]
    count[BC[i][1]] += count[BC[i][0]]
    count[BC[i][0]] = 0
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split(' ')))

A.sort()
A.append([0])
ans = 0
for i in range(N):
    if A[i] != A[i + 1]:
        flag = True
        for j in range(i):
            if A[i] % A[j] == 0:
                flag = False
                break
        if flag:
            ans += 1

print(ans)

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

A.sort()
A.append(0)
dp = [True] * (10 ** 6 + 5)
ans = 0
for i in range(N):
    if dp[A[i]-1]:
        if A[i] != A[i + 1]:
            ans += 1
        dp[A[i]-1::A[i]] = [False] * (len(dp) // A[i])

print(ans)
Buggy python submission (verdict: Runtime Error):
import math

A, B = input().split(' ')

B = round(B * 100)
print(math.floor(A * B // 100))

Fixed submission:
import math

A, B = input().split(' ')

A = int(A)
B = round(float(B) * 100)
print(math.floor(A * B // 100))

Buggy python submission (verdict: Runtime Error):
import math

AB = list(map(int, input().split(' ')))

print(math.floor(AB[0] * AB[1]))

Fixed submission:
import math

A, B = input().split(' ')

A = int(A)
B = round(float(B) * 100)
print(math.floor(A * B // 100))
Buggy python submission (verdict: Runtime Error):
import numpy as np

A, B, H, M = map(int, input().split())

Aw = 2 * np.pi / 12 / 60
Bw = 2 * np.pi / 60
thetaA = Aw * (H * 60 + M)
thetaB = Bw * M
# thetaA = 2 * np.pi * H / 12 + 2 * np.pi / 12 * M / 60
# thetaB = 2 * np.pi * M / 60

if thetaA + thetaB == np.pi:
if thetaA > thetaB:
    ans = np.sqrt(A ** 2 + B ** 2 - 2 * A * B * np.cos(thetaA - thetaB))
elif thetaB > thetaA:
    ans = np.sqrt(A ** 2 + B ** 2 - 2 * A * B * np.cos(thetaB - thetaA))
else:
    ans = B - A

print(ans)


Fixed submission:
import numpy as np

A, B, H, M = map(int, input().split())

Aw = 2 * np.pi / 12 / 60
Bw = 2 * np.pi / 60
thetaA = Aw * (H * 60 + M)
thetaB = Bw * M
# thetaA = 2 * np.pi * H / 12 + 2 * np.pi / 12 * M / 60
# thetaB = 2 * np.pi * M / 60

if thetaA > thetaB:
    ans = np.sqrt(A ** 2 + B ** 2 - 2 * A * B * np.cos(thetaA - thetaB))
elif thetaB > thetaA:
    ans = np.sqrt(A ** 2 + B ** 2 - 2 * A * B * np.cos(thetaB - thetaA))
else:
    ans = abs(A - B)

print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools
import numpy as np
import copy

N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for _ in range(N)]
CA = np.array(CA)

ans = 10 ** 7
for i in itertools.product([0, 1], repeat=N):
    tCA = copy.copy(CA)
    for j in range(N):
        if i[j] == 0:
            tCA[j] = np.zeros(CA.shape[1])
    s = np.sum(tCA, axis=0)
    l = sum(k >= X for k in s[1:])
    if s[0] < ans and l == M:
        ans = s[0]

if ans == 10 ** 7:
    print(-1)
else:
    print(ans)


Fixed submission:
import itertools
import numpy as np
import copy

N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for _ in range(N)]
CA = np.array(CA)

ans = 10 ** 7
for i in itertools.product([0, 1], repeat=N):
    tCA = copy.copy(CA)
    for j in range(N):
        if i[j] == 0:
            tCA[j] = np.zeros(CA.shape[1])
    s = np.sum(tCA, axis=0)
    l = sum(k >= X for k in s[1:])
    if s[0] < ans and l == M:
        ans = s[0]

if ans == 10 ** 7:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for _ in range(N)]
CA = np.array(CA)

ans = 10 ** 7
for i in itertools.product([0, 1], repeat=N):
    tCA = copy.copy(CA)
    for j in range(N):
        if i[j] == 0:
            tCA[j] = np.zeros(CA.shape[1])
    s = np.sum(tCA, axis=0)
    l = sum(k >= X for k in s[1:])
    if s[0] < ans and l == M:
        ans = s[0]

if ans == 10 ** 7:
    print(-1)
else:
    print(ans)


Fixed submission:
import itertools
import numpy as np
import copy

N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for _ in range(N)]
CA = np.array(CA)

ans = 10 ** 7
for i in itertools.product([0, 1], repeat=N):
    tCA = copy.copy(CA)
    for j in range(N):
        if i[j] == 0:
            tCA[j] = np.zeros(CA.shape[1])
    s = np.sum(tCA, axis=0)
    l = sum(k >= X for k in s[1:])
    if s[0] < ans and l == M:
        ans = s[0]

if ans == 10 ** 7:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

t = [0] * (10 ** 10)
ans = 0
for i in range(N):
    sa = i - A[i]
    ans += t[sa]
    wa = i + A[i]
    t[wa] += 1

print(ans)


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

t = [0] * (N + 1)
ans = 0
for i in range(N):
    sa = i - A[i]
    if sa >= 0:
        ans += t[sa]
    wa = i + A[i]
    if wa < N:
        t[wa] += 1

print(ans)

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

t = [0] * N + [0] * 10 ** 6
ans = 0
for i in range(N):
    sa = i - A[i]
    ans += t[sa]
    wa = i + A[i]
    t[wa] += 1

print(ans)


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

t = [0] * (N + 1)
ans = 0
for i in range(N):
    sa = i - A[i]
    if sa >= 0:
        ans += t[sa]
    wa = i + A[i]
    if wa < N:
        t[wa] += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split())
a.sort()
print(10*a[2]+a[1]+a[0])

Fixed submission:
a = list(map(int,input().split()))
a.sort()
print(10*a[2]+a[1]+a[0])

Buggy python submission (verdict: Runtime Error):
a = list(int,input().split())
a.sort()
print(10*a[2]+a[1]+a[0])

Fixed submission:
a = list(map(int,input().split()))
a.sort()
print(10*a[2]+a[1]+a[0])
Buggy python submission (verdict: Runtime Error):
n,m,X,Y = input().split()
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.append(X)
y.append(Y)
if max(x)<min(y):
    print("No War")
else:
    print("War")

Fixed submission:
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.append(X)
y.append(Y)
if max(x)<min(y):
    print("No War")
else:
    print("War")

Buggy python submission (verdict: Runtime Error):
n,m,X,Y = input().split()
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.append(X)
y.append(Y)
print(max(x)<min(y)?"No war":"War")

Fixed submission:
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
x.append(X)
y.append(Y)
if max(x)<min(y):
    print("No War")
else:
    print("War")
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
cnt=[]
for i in range(len(S)-len(T)):
    count=0
    kari=S[i:i+len(T)]
    for j in range(len(T)):
        if kari[j]!=T[j]:
            count+=1
    cnt.append(count)
print(min(cnt))

Fixed submission:
S=input()
T=input()
cnt=[]
if len(S)==len(T):
    kazu=0
    for i in range(len(S)):
        if S[i]!=T[i]:
            kazu+=1
    cnt.append(kazu)


for i in range(len(S)-len(T)):
    count=0
    kari=S[i:i+len(T)]
    for j in range(len(T)):
        if kari[j]!=T[j]:
            count+=1
    cnt.append(count)
print(min(cnt))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=0
A=list(map(int,input().split()))
for i in range(N-1):
    for j in range(i+1,N):
        ans+=A[i]*A[j]
print(ans%(10**9+7))

Fixed submission:
N=int(input())
ans=0

A=list(map(int,input().split()))
zentai=sum(A)
ruiseki_WA=[]
kasu=0
for i in range(N):
    kasu+=A[i]
    ruiseki_WA.append(kasu)
hako=sum(A)
for i in range(N):
    ans+=A[i]*(hako-ruiseki_WA[i])   
print(ans%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N=int(input())
ans=0
yakusu=[0]*(10**7+1)
for i in range(1,N+1):
    for j in range(i,N+1,i):
        yakusu[j]+=1
for i in range(len(yakusu)):
    ans+=(i)*yakusu[i]
print(ans)

Fixed submission:
N=int(input())
ans=0
yakusu=[0]*(10**7+1)
for i in range(1,N+1):
    for j in range(i,N+1,i):
        yakusu[j]+=1
for i in range(len(yakusu)):
    ans+=(i)*yakusu[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=0
yakusu=[0]*(10**7+1)
for i in range(1,N+1):
    for j in range(i,N+1,i):
        yakusu[j]+=1
for i in range(len(yakusu)):
    ans+=(i)*yakusu[i]
print(ans)

Fixed submission:
N=int(input())
ans=0
yakusu=[0]*(10**7+1)
for i in range(1,N+1):
    for j in range(i,N+1,i):
        yakusu[j]+=1
for i in range(len(yakusu)):
    ans+=(i)*yakusu[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
X=int(input())
shukai=360
while True:
    if shukai%X==0:
        print(shukai//X)
        exit()
    else:
        shukai*=2

Fixed submission:
def gcda(a,b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    return gcda(r, b)

def lcm(a,b):
    return a*b//gcda(a,b)

X=int(input())
shukai=360
while True:
    if shukai%X==0:
        print(shukai//X)
        exit()
    else:
        shukai=lcm(shukai,X)
Buggy python submission (verdict: Runtime Error):
import bisect
X,N=map(int,input().split())
P=list(map(int,input().split()))
hako=set(P)
kari=[]
if X<P[0]:
    print(X)
    exit()
if X>P[-1]:
    print(X)
    exit()
for i in range(102):
    if i not in hako:
        kari.append(i)
#print(kari)
kari.sort()
tekitpu=kari[bisect.bisect_left(kari,X)]
aho=kari[bisect.bisect_left(kari,X)-1]
#print(tekitpu,aho)
if abs(tekitpu-X)<abs(X-aho):
    print(tekitpu)
else:
    print(aho)


Fixed submission:
X,N=map(int,input().split())
P=list(map(int,input().split()))
hako=set(P)
#print(hako)
ans=[]
P.sort()
kari=[]
for i in range(102):
    if i not in hako:
        kari.append(i)
for i in range(len(kari)):
    ans.append([abs(X-kari[i]),kari[i]])
ans.sort()
print(ans[0][1])

Buggy python submission (verdict: Runtime Error):
import bisect
X,N=map(int,input().split())
P=list(map(int,input().split()))
P=set(P)
A=[]
for i in range(101):
    if i not in P:
        A.append(i)
zahyo=bisect.bisect_left(A,X)
ans=[]
ans.append([abs(X-A[zahyo]),A[zahyo]])
ans.append([abs(X-A[zahyo-1]),A[zahyo-1]])
ans.sort()
print(ans[0][1])

Fixed submission:
X,N=map(int,input().split())
P=list(map(int,input().split()))
hako=set(P)
#print(hako)
ans=[]
P.sort()
kari=[]
for i in range(102):
    if i not in hako:
        kari.append(i)
for i in range(len(kari)):
    ans.append([abs(X-kari[i]),kari[i]])
ans.sort()
print(ans[0][1])

Buggy python submission (verdict: Runtime Error):
import bisect
X,N=map(int,input().split())
P=list(map(int,input().split()))
hako=set(P)
P.sort()
kari=[]
if len(P)==0:
    print(100)
    exit()
if X<P[0]:
    print(X)
    exit()
if X>P[-1]:
    print(X)
    exit()
for i in range(-200,101):
    if i not in hako:
        kari.append(i)
#print(kari)
tekitpu=kari[bisect.bisect_left(kari,X)]
aho=kari[bisect.bisect_left(kari,X)-1]
#print(tekitpu,aho)
if abs(tekitpu-X)<abs(X-aho):
    print(tekitpu)
else:
    print(aho)

Fixed submission:
X,N=map(int,input().split())
P=list(map(int,input().split()))
hako=set(P)
#print(hako)
ans=[]
P.sort()
kari=[]
for i in range(102):
    if i not in hako:
        kari.append(i)
for i in range(len(kari)):
    ans.append([abs(X-kari[i]),kari[i]])
ans.sort()
print(ans[0][1])

Buggy python submission (verdict: Runtime Error):
import bisect
X,N=map(int,input().split())
P=list(map(int,input().split()))
hako=set(P)
P.sort()
kari=[]
if len(P)==0:
    print(100)
    exit()
if X<P[0]:
    print(X)
    exit()
if X>P[-1]:
    print(X)
    exit()
for i in range(101):
    if i not in hako:
        kari.append(i)
#print(kari)
tekitpu=kari[bisect.bisect_left(kari,X)]
aho=kari[bisect.bisect_left(kari,X)-1]
#print(tekitpu,aho)
if abs(tekitpu-X)<abs(X-aho):
    print(tekitpu)
else:
    print(aho)

Fixed submission:
X,N=map(int,input().split())
P=list(map(int,input().split()))
hako=set(P)
#print(hako)
ans=[]
P.sort()
kari=[]
for i in range(102):
    if i not in hako:
        kari.append(i)
for i in range(len(kari)):
    ans.append([abs(X-kari[i]),kari[i]])
ans.sort()
print(ans[0][1])
Buggy python submission (verdict: Runtime Error):
kari

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

Buggy python submission (verdict: Runtime Error):
test

Fixed submission:
A,B=map(int,input().split())
print(A*B)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ans=1
for i in range(N):
    ans*=A[i]
if ans>10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
ans=1
if 0 in A:
    print(0)
    exit()
for i in range(N):
    ans*=A[i]
    if ans>10**18:
        print(-1)
        exit()
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
うんち

Fixed submission:
S=input()
T=input()
if S[0:len(T)-1] ==T[0:len(T)-1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
うんし

Fixed submission:
S,W=map(int,input().split())
if W>=S:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
count=0
S=input()
for i in range(N):
    for j in range(i,N):
        if S[i]==S[j]:
            continue
        for k in range(j,N):
            if j-i!=k-j:
                if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
                    count+=1
print(count)

Fixed submission:
N=int(input())
S=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,N):
        k=j+j-i
        if k>=N:
            continue
        if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
            ans-=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
count=0
S=input()
for i in range(N):
    for j in range(i,N):
        for k in range(j,N):
            if j-i!=k-j:
                if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
                    count+=1
print(count)

Fixed submission:
N=int(input())
S=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,N):
        k=j+j-i
        if k>=N:
            continue
        if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
            ans-=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())
ans=set()
for i in range(1,10):
    ans.add(i)
def saiki(A):
    genzai_saigo=int(A[-1])
    ketasu=len(A)
    if ketasu>0:
        B="".join(A)
        ans.add(eval(B))
    if ketasu==10:
        return
    for i in [genzai_saigo-1,genzai_saigo,genzai_saigo+1]:
        if i < 0 or i>9:
            continue
        A.append(str(i))
        saiki(A)
        A.pop()
for i in range(1,10):
    saiki([str(i)])
kotae=list(ans)
kotae.sort()
print(kotae[K-1])

Fixed submission:
K=int(input())
ans=set()
for i in range(1,10):
    ans.add(i)
def saiki(A):
    genzai_saigo=int(A[-1])
    ketasu=len(A)
    if ketasu>0:
        B="".join(A)
        ans.add(eval(B))
    if ketasu==10:
        return
    for i in [genzai_saigo-1,genzai_saigo,genzai_saigo+1]:
        if i < 0 or i>9:
            continue
        A.append(str(i))
        saiki(A)
        A.pop()
for i in range(1,10):
    saiki([str(i)])
kotae=list(ans)
kotae.sort()
print(kotae[K-1])
Buggy python submission (verdict: Runtime Error):
L=int(input())
ans=[]
for i in range(1,L+1):
    for j in range(1,L-i+1):
        ans.append(i*j*(L-i-j))
print(max(ans))

Fixed submission:
L=int(input())
print((L/3)**3)
Buggy python submission (verdict: Runtime Error):
import math 
from decimal import Decimal a,b,c=map(int,input().split()) 
A=Decimal(a) 
B=Decimal(b)
C=Decimal(c) 
if math.sqrt(A)+math.sqrt(B)<math.sqrt(C): 
    print("Yes") 
else: 
    print("No") 

Fixed submission:
import math 
from decimal import Decimal 
a,b,c=map(int,input().split()) 
A=Decimal(a)**Decimal(0.5) 
B=Decimal(b)**Decimal(0.5)
C=Decimal(c)**Decimal(0.5)
if A+B<C: 
    print("Yes") 
else: 
    print("No")
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int,input().split()))
ans=[]
for i in range(min(X),max(X)):
    goukei = 0
    for j in range(N):
        if i%1==0:
            goukei+=(X[j]-i)**2
    ans.append(goukei)
kotae=set(ans)
print(min(kotae))

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
ans=[]
for i in range(max(X)+1):
    goukei = 0
    for j in range(N):
        if i%1==0:
            goukei+=(X[j]-i)**2
    ans.append(goukei)
kotae=set(ans)
print(min(kotae))

Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int,input().split()))
ans=[]
for i in range(min(X),max(X)):
    goukei = 0
    for j in range(len(X)):
        if i%1==0:
            goukei+=(X[j]-i)**2
    ans.append(goukei)
kotae=set(ans)
print(min(kotae))

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
ans=[]
for i in range(max(X)+1):
    goukei = 0
    for j in range(N):
        if i%1==0:
            goukei+=(X[j]-i)**2
    ans.append(goukei)
kotae=set(ans)
print(min(kotae))

Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int,input().split()))
ans=[]
for i in range(min(X),max(X)):
    goukei = 0
    for j in range(len(X)):
        goukei+=(X[j]-i)**2
    ans.append(goukei)
kotae=set(ans)
print(min(kotae))

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
ans=[]
for i in range(max(X)+1):
    goukei = 0
    for j in range(N):
        if i%1==0:
            goukei+=(X[j]-i)**2
    ans.append(goukei)
kotae=set(ans)
print(min(kotae))

Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int,input().split()))
ans=[]
for i in range(min(X),max(X)):
    goukei = 0
    for j in range(len(X)):
        goukei+=(X[j]-i)**2
    ans.append(goukei)
print(min(ans))



Fixed submission:
N=int(input())
X=list(map(int,input().split()))
ans=[]
for i in range(max(X)+1):
    goukei = 0
    for j in range(N):
        if i%1==0:
            goukei+=(X[j]-i)**2
    ans.append(goukei)
kotae=set(ans)
print(min(kotae))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[input() for i in range(N)]
S.sort()
def list_count(my_list):
    dic={} #辞書型の宣言
    for num in my_list:
        if num in dic: #もしnumがkeyとして辞書にあれば
            dic[num]+=1 #valueに+1
        else: #なければ
            dic[num]=1 #dicにnumというkeyを追加し、対応するvalueを1とする
    return dic

A=list_count(S)
max_k_list = [kv[0] for kv in A.items() if kv[1] == max(A.values())]
max_k_list.sort()
for j in range(len(max_k_list)):
    print(max_k_list[j])

Fixed submission:
N=int(input())
S=[input() for i in range(N)]
S.sort()
def list_count(my_list):
    dic={} #辞書型の宣言
    for num in my_list:
        if num in dic: #もしnumがkeyとして辞書にあれば
            dic[num]+=1 #valueに+1
        else: #なければ
            dic[num]=1 #dicにnumというkeyを追加し、対応するvalueを1とする
    return dic
K=[]
A=list_count(S)
ookii=max(A.values())
K.append(ookii)
max_k_list = [kv[0] for kv in A.items() if kv[1] == K[0]]
max_k_list.sort()
for j in range(len(max_k_list)):
    print(max_k_list[j])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N=int(input())
P=list(map(int,input().split()))
count = 0
for i in range(N):
    if P[i]<=min(P[:i+1]):
        count += 1
print(count)


Fixed submission:
import sys
input = sys.stdin.readline
N=int(input())
P=list(map(int,input().split()))
count = 0
saisyouti = P[0]
for i in range(N):
    if P[i]<=saisyouti:
        count += 1
        saisyouti=P[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
count = 0
kouho=[]

for i in range(N):
    if P[i]<=min(P[:i+1]):
        count += 1
print(count)

Fixed submission:
import sys
input = sys.stdin.readline
N=int(input())
P=list(map(int,input().split()))
count = 0
saisyouti = P[0]
for i in range(N):
    if P[i]<=saisyouti:
        count += 1
        saisyouti=P[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
count = 0
for i in range(N):
    if P[i]<=min(P[:i+1]):
        count += 1
print(count)

Fixed submission:
import sys
input = sys.stdin.readline
N=int(input())
P=list(map(int,input().split()))
count = 0
saisyouti = P[0]
for i in range(N):
    if P[i]<=saisyouti:
        count += 1
        saisyouti=P[i]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
PS=[input().split() for i in range(M)]
ACzumi=[]
WA_count=[]
for i in range(M):
    if not PS[i][0] in ACzumi:
        if PS[i][1]=="AC":
            ACzumi.append(PS[i][0])
        else:
            WA_count.append(PS[i][0])
yokei=0            
for i in range(len(WA_count)):
    if not WA_count[i] in ACzumi:
        yokei+=1
        
#print(ACzumi)
print(len(ACzumi),len(WA_count)-yokei)

Fixed submission:
N,M=map(int,input().split())
PS=[input().split() for i in range(M)]
ACzumi=set()
WA_count=[]
for i in range(M):
    if not PS[i][0] in ACzumi:
        if PS[i][1]=="AC":
            ACzumi.add(PS[i][0])
        else:
            WA_count.append(PS[i][0])
yokei=0            
for i in range(len(WA_count)):
    if not WA_count[i] in ACzumi:
        yokei+=1
        
#print(ACzumi)
print(len(ACzumi),len(WA_count)-yokei)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
ans = list(input().split() for i in range(M))
count = 0
hantei = []
cnt = 0
for i in range(len(ans)):
    if ans[i][1]=="AC":
        count += 1
        hantei.append(ans[i][0])

    else:
        cnt += 1
kotae = set(hantei)
kari=[ans[i][1] for i in range(len(ans))]
kari.reverse()

print(count-(count-len(kotae)),cnt-kari.index("AC"))

Fixed submission:
N,M=map(int,input().split())
PS=[input().split() for i in range(M)]
ACzumi=set()
WA_count=[]
for i in range(M):
    if not PS[i][0] in ACzumi:
        if PS[i][1]=="AC":
            ACzumi.add(PS[i][0])
        else:
            WA_count.append(PS[i][0])
yokei=0            
for i in range(len(WA_count)):
    if not WA_count[i] in ACzumi:
        yokei+=1
        
#print(ACzumi)
print(len(ACzumi),len(WA_count)-yokei)