Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
T=[]
t=[]
for i in range(5):
    T.append(int(input()))
    t.append(T[i]%10)
while 0 in t :
    t.remove(0)
ans = sum(T)+10*len(t)-sum(t)-10+min(t)
print(ans)

Fixed submission:
T=[]
t=[]
for i in range(5):
    T.append(int(input()))
    t.append(T[i]%10)
if max(t) == 0 :
    ans = sum(T)
else :
    while 0 in t  :
        t.remove(0)
    ans = sum(T)+10*len(t)-sum(t)-10+min(t)
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
Xa={}
ans=0
for i in range(N):
    V,S=map(int,input().split())
    Xa[V]=S
Xb=sorted(Xa.items())
for i in range (N) :
    M -= Xb[i][1]
    ans += Xb[i][0]*Xb[i][1]
    if M <= 0 :
        ans -= abs(M)*Xb[i][0]
        break

print(ans)

Fixed submission:
N,M=map(int,input().split())
Xa={}
ans=0
for i in range(N):
    V,S=map(int,input().split())
    if V in Xa :
        Xa[V] += S
    else :
        Xa[V]=S
Xb=sorted(Xa.items())
for i in range (len(Xb)) :
    M -= Xb[i][1]
    ans += Xb[i][0]*Xb[i][1]
    if M <= 0 :
        ans -= abs(M)*Xb[i][0]
        break
 
print(ans)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
Xa={}
ans=0
for i in range(N):
    V,S=map(int,input().split())
    Xa[V]=S
Xb=sorted(Xa.items())
for i in range (N) :
    M -= Xb[i][1]
    ans += Xb[i][0]*Xb[i][1]
    if M < 0 :
        ans -= abs(M)*Xb[i][0]
        break
    elif M == 0 :
        break
print(ans)

Fixed submission:
N,M=map(int,input().split())
Xa={}
ans=0
for i in range(N):
    V,S=map(int,input().split())
    if V in Xa :
        Xa[V] += S
    else :
        Xa[V]=S
Xb=sorted(Xa.items())
for i in range (len(Xb)) :
    M -= Xb[i][1]
    ans += Xb[i][0]*Xb[i][1]
    if M <= 0 :
        ans -= abs(M)*Xb[i][0]
        break
 
print(ans)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
Xa={}
ans=0
for i in range(N):
    V,S=map(int,input().split())
    Xa[V]=S
Xb=sorted(Xa.items())
for i in range (N) :
    M -= Xb[i][1]
    ans += Xb[i][0]*Xb[i][1]
    if M < 0 :
        ans -= abs(M)*Xb[i][0]
        break
print(ans)

Fixed submission:
N,M=map(int,input().split())
Xa={}
ans=0
for i in range(N):
    V,S=map(int,input().split())
    if V in Xa :
        Xa[V] += S
    else :
        Xa[V]=S
Xb=sorted(Xa.items())
for i in range (len(Xb)) :
    M -= Xb[i][1]
    ans += Xb[i][0]*Xb[i][1]
    if M <= 0 :
        ans -= abs(M)*Xb[i][0]
        break
 
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

#sys.stdin = open('b_2.txt', 'r')

N = int(raw_input())
rest = [0 for _ in range(N)]
ins = [0 for _ in range(N)]
pairs = 0
for x in range(N):
	n = long(raw_input())
	ins[x] = n
	pairs += n / 2
	rest[x] = n % 2

for x in range(0, N - 1, 1):
	if ((rest[x] == 1) and (rest[x + 1] == 1)):
		pairs += 1
	elif ((rest[x] == 1) and (rest[x + 1] == 0) and (ins[x + 1] > 0)):
		rest[x + 1] = 1
		ins[x + 1] -= 2
		rest[x] = 0
	else:
		pass

print str(pairs)


Fixed submission:
import sys
#sys.stdin = open('a_3.txt', 'r')
chars = list(raw_input())
#N, E, S, W
directions = [0 for _ in range(4)]

for c in chars:
	if c == 'N':
		directions[0] = 1
	elif c == 'E':
		directions[1] = 1
	elif c == 'S':
		directions[2] = 1
	else:
		directions[3] = 1

if ((directions[0] == directions[2]) and (directions[1] == directions[3])):
	print 'Yes'
else:
	print 'No'
Buggy python submission (verdict: Runtime Error):
import sys

sys.stdin = open('b_1.txt', 'r')

N = int(raw_input())
rest = [0 for _ in range(N)]
pairs = 0
for x in range(N):
	n = long(raw_input())
	pairs += n / 2
	rest[x] = n % 2

for x in range(1, N, 1):
	if ((rest[x - 1] == 1) and (rest[x] == 1)):
		pairs += 1
		rest[x] = 0

print str(pairs)


Fixed submission:
import sys

#sys.stdin = open('b_2.txt', 'r')

N = int(raw_input())
rest = [0 for _ in range(N)]
ins = [0 for _ in range(N)]
pairs = 0
for x in range(N):
	n = long(raw_input())
	ins[x] = n
	pairs += n / 2
	rest[x] = n % 2

for x in range(0, N - 1, 1):
	if ((rest[x] == 1) and (rest[x + 1] == 1)):
		pairs += 1
		rest[x] = 0
		rest[x + 1] = 0
	elif ((rest[x] == 1) and (rest[x + 1] == 0) and (ins[x + 1] > 0)):
		rest[x + 1] = 1
		ins[x + 1] -= 2
		rest[x] = 0
	else:
		pass

print str(pairs)
Buggy python submission (verdict: Runtime Error):
import sys

sys.stdin = open('a_2.txt', 'r')
N = int(raw_input())

print str(((N+1) * N) / 2)


Fixed submission:
import sys

#sys.stdin = open('a_2.txt', 'r')
N = int(raw_input())

print str(((N+1) * N) / 2)
Buggy python submission (verdict: Time Limit Exceeded):
import math
K = int(input())
ans = 0
for i in range(K):
    for j in range(K):
        for k in range(K):
            ans += math.gcd(i+1, math.gcd(j+1, k+1))
print(ans)


Fixed submission:
import math
K = int(input())
ans = 0
for i in range(1, K+1):
    for j in range(i, K+1):
        for k in range(j, K+1):
            if (i == j) and (j == k):
                ans += math.gcd(i, math.gcd(j, k))
            elif (i == j) or (j == k):
                ans += 3 * math.gcd(i, math.gcd(j, k))
            else:
                ans += 6 * math.gcd(i, math.gcd(j, k))
print(ans)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1E9 + 9;
const int INF = 1<<29; 

long long f(long long x){
    if(x == 1) return 1;
    return f(x/2) * 2 + 1;
}

int main(){
    long long H;
    cin >> H;
    cout << f(H) << endl;
    return 0;
}

Fixed submission:
import numpy as np
import math
H = int(input())

cnt = np.log2(H)
cnt = math.floor(cnt)
cnt = 2**(cnt + 1) - 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import math

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

for i in range(M):
    j = A.argmax()
    A[j]  =  math.floor(A[j] / 2)

print(A.sum())


Fixed submission:
import numpy as np
import math
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: [-int(x),int(x)], input().split()))
heapq.heapify(A)

for i in range(M):
    x = heapq.heappop(A)
    x[1] //= 2
    x[0] = -x[1]
    heapq.heappush(A, x)

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

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(A)
A_ix = A.argsort()[::-1]

for i in range(M):
    if(A[A_ix[0]] > A[A_ix[1]]):
        A[A_ix[0]]  =  math.floor(A[A_ix[0]] / 2)
    else:
        A_ix = A.argsort()[::-1]
        A[A_ix[0]]  =  math.floor(A[A_ix[0]] / 2)

print(A.sum())


Fixed submission:
import numpy as np
import math
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: [-int(x),int(x)], input().split()))
heapq.heapify(A)

for i in range(M):
    x = heapq.heappop(A)
    x[1] //= 2
    x[0] = -x[1]
    heapq.heappush(A, x)

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

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(A)
A_ix = A.argsort()[::-1]
j = 0

for i in range(M):
    if(A[A_ix[j]] > A[A_ix[j+1]]):
        A[A_ix[j]]  =  math.floor(A[A_ix[j]] / 2)
    else:
        A_ix = A.argsort()[::-1]
        A[A_ix[j]]  =  math.floor(A[A_ix[j]] / 2)

print(A.sum())


Fixed submission:
import numpy as np
import math
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: [-int(x),int(x)], input().split()))
heapq.heapify(A)

for i in range(M):
    x = heapq.heappop(A)
    x[1] //= 2
    x[0] = -x[1]
    heapq.heappush(A, x)

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

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import math

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

for i in range(M):
    A[A.argmax()]  =  math.floor(A[A.argmax()] / 2)

print(A.sum())


Fixed submission:
import numpy as np
import math
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: [-int(x),int(x)], input().split()))
heapq.heapify(A)

for i in range(M):
    x = heapq.heappop(A)
    x[1] //= 2
    x[0] = -x[1]
    heapq.heappush(A, x)

ans = 0
for i in range(N):
    ans += A[i][1]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
tree = list()
ope = list()
cnt = [0] * N
for i in range(N-1):
    tree.append(list(map(int, input().split())))
for i in range(Q):
    ope.append(list(map(int, input().split())))

#print(tree, ope)

for i in range(Q):
    vertex = ope[i][0]
    add = ope[i][1]
    parent = list()
    parent.append(vertex)
    for j in range(N-1):
        #print(j, tree[j][0], parent)
        if tree[j][0] in parent:
            parent.append(tree[j][1])
        if tree[j][1] in parent:
            cnt[j+1] += add
    if vertex == 1:
        cnt[0] += add
#print(tree)
for i in cnt:
  print(i, end =" ")


Fixed submission:
N, Q = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(N-1)]
px = [list(map(int, input().split())) for i in range(Q)]
cnt = [0] * N

for p, x in px:
    cnt[p-1] += x
for a, b in sorted(ab):
    cnt[b-1] += cnt[a-1]

print(*cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
cnt = 0
l = list()

for i in range(N-1):
    if p[i] > p[i+1]:
        cnt += 1
        l.append(i)

if cnt <= 1:
    print('YES')
elif (cnt==2) and (p[l[0]-1] <= p[l[1]+1] <= p[l[0]+1]) and (p[l[1]] <= p[l[0]] <= p[l[1]+2]):
    print('YES')
else: print('NO')


Fixed submission:
N = int(input())
p = list(map(int, input().split()))
cnt = 0
l = list()

for i in range(N-1):
    if p[i] > p[i+1]:
        cnt += 1
        l.append(i)

if cnt > 2:
    print('NO')
if cnt == 1:
    print('NO')
if cnt == 0:
    print('YES')
if cnt == 2:
    p[l[0]], p[l[1]+1] = p[l[1]+1], p[l[0]]
    cnt = 0
    for i in range(N-1):
        if p[i] > p[i+1]:
            cnt += 1
            l.append(i)
    if cnt == 0:
        print('YES')
    else:
        print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for i in range(N)]
A_sub = A.copy()
A_sub.sort(reverse=True)
#print(A)

for i in range(N):
    # print(A[i])
    A_sub2 = A_sub.copy()
    A_sub2.remove(A[i])
    print(A_sub2[0])
    


Fixed submission:
N=int(input())
A=[int(input()) for i in range(N)]
A_sub = A.copy()
MAX = max(A)
A_sub.remove(MAX)
MAX2 = max(A_sub)

for i in range(N):
    if A[i] < MAX:
        print(MAX)
    elif A[i] == MAX:
        print(MAX2)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
using namespace std;

uint64_t gcd(uint64_t a, uint64_t b)
{
    uint64_t r;
    while ((r = a % b) != 0) {
        a = b;
        b = r;
    }

    return b;
}

uint64_t binomial(uint64_t n, uint64_t r)
{
    r = (r > n / 2) ? n - r : r;
    uint64_t result = 1;

    for (uint64_t i = 1; i <= r; i++, n--) {
        int d = gcd(result, i);

        result /= d;
        result *= n / (i / d);
    }

    return result;
}

int main(){
    int N, K;
    cin >> N >> K;
    int ans;
    
    for(int i=1; i<=K; i++){
        ans = binomial(N-K+1, i) * binomial(K-1, i-1);
        ans = ans % int(1E9 + 7);
        cout << ans << endl;
    }
}

Fixed submission:
n, k = list(map(int, input().split()))
lim = 10**9 + 7
C = [[1], [1,1]]

for i in range(2, n+10):
    C.append([1] + [(C[i-1][j-1] + C[i-1][j])%lim for j in range(1, i)] + [1])

for i in range(1, k+1):
    if n-k+1 < i  or k < i:
        #赤ボールが操作回数よりも少ない時、青ボールが操作回数よりも少ない時
        print(0)
    else:
        #青ボールを入れる箇所の組み合わせ×各箇所に入れる青ボール個数の組み合わせ
        print((C[n-k+1][i]*C[k-1][i-1])%lim)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = sorted(list(map(int, input().split())))

a_max = a[-1]
ans_list = [0] * a_max

ans = 0

for i in range(n):

    p = a[i]
    if a.count(p) > 1:
        continue

    if ans_list[p-1] == 0:
        for q in range(1, (a_max//p)+1):
            ans_list[p*q-1] = 1
            
        ans += 1

print(ans)


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

a_max = a[-1]
ans_list = [0] * a_max

ans = 0

for i in range(n-1):

    p = a[i]

    if ans_list[p-1] == 0:
        for q in range(1, (a_max//p)+1):
            ans_list[p*q-1] = 1
            
        if a[i] != a[i+1]:
            ans += 1

if ans_list[a_max-1] == 0:
    ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())))

a_max = a[-1]
ans_list = [0] * a_max

ans = 0

for i in range(n):

    p = a[i]
    
    if ans_list[p-1] == 0:
        for q in range(1, (a_max//p)+1):
            ans_list[p*q-1] = 1
        
        if a[i] != a[i+1]:
            ans += 1

print(ans)

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

a_max = a[-1]
ans_list = [0] * a_max

ans = 0

for i in range(n-1):

    p = a[i]

    if ans_list[p-1] == 0:
        for q in range(1, (a_max//p)+1):
            ans_list[p*q-1] = 1
            
        if a[i] != a[i+1]:
            ans += 1

if ans_list[a_max-1] == 0:
    ans += 1

print(ans)

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

ans = 0
for i in range(n):
    count = 0
    for j in range(n):
        if i == j:
            continue

        elif a[i] % a[j] == 0:
            count += 1
            break
        else:
            continue
    if count == 0:
        ans += 1

print(ans)

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

a_max = a[-1]
ans_list = [0] * a_max

ans = 0

for i in range(n-1):

    p = a[i]

    if ans_list[p-1] == 0:
        for q in range(1, (a_max//p)+1):
            ans_list[p*q-1] = 1
            
        if a[i] != a[i+1]:
            ans += 1

if ans_list[a_max-1] == 0:
    ans += 1

print(ans)

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

ans = 0
for i in range(n):
    count = 0
    for j in range(n):
        if i == j:
            continue

        elif a[i] % a[j] == 0:
            count += 1
        else:
            continue
    if count == 0:
        ans += 1

print(ans)

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

a_max = a[-1]
ans_list = [0] * a_max

ans = 0

for i in range(n-1):

    p = a[i]

    if ans_list[p-1] == 0:
        for q in range(1, (a_max//p)+1):
            ans_list[p*q-1] = 1
            
        if a[i] != a[i+1]:
            ans += 1

if ans_list[a_max-1] == 0:
    ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
sys.setrecursionlimit(10**7)

def teleport(city, end, teleportmap, count=1):

    next_city = teleportmap[city]

    if count == end:
        return next_city

    else:
        return teleport(next_city, end, teleportmap, count+1)

n, k = map(int,input().split())
a = list(map(int, input().split()))
teleportmap = dict(zip(range(1, len(a)+1), a))

if k <= n:
    print(teleport(1, n, teleportmap))

else:
    countmap = [0]*n
    countmap[0] = 1

    next_city =1
    for _ in range(1, n+1):
        next_city = a[next_city-1]
        countmap[next_city -1] += 1
        if countmap[next_city -1] == 2:
            start = next_city
            break

    roop = {}
    for j in range(1, n+1):
        roop[start] = teleportmap[start]
        start = roop[start]
    
    num_r = len(roop)

    num_until_r= 0
    for m in teleportmap.keys():
        if m not in roop and countmap[m-1] != 0:
            num_until_r += 1
    
    k_r = k - num_until_r
    num_end = k_r%num_r

    if num_end == 0:
        print(next_city)
        
    else:
        print(teleport(next_city, num_end, roop))

Fixed submission:
import sys
sys.setrecursionlimit(10**7)

def teleport(city, end, teleportmap, count=1):

    next_city = teleportmap[city]

    if count == end:
        return next_city

    else:
        return teleport(next_city, end, teleportmap, count+1)

n, k = map(int,input().split())
a = list(map(int, input().split()))
teleportmap = dict(zip(range(1, len(a)+1), a))

if k <= n:
    print(teleport(1, k, teleportmap))

else:
    countmap = [0]*n
    countmap[0] = 1

    next_city =1
    for _ in range(1, n+1):
        next_city = a[next_city-1]
        countmap[next_city -1] += 1
        if countmap[next_city -1] == 2:
            start = next_city
            break

    roop = {}
    for j in range(1, n+1):
        roop[start] = teleportmap[start]
        start = roop[start]
    
    num_r = len(roop)

    num_until_r= 0
    for m in teleportmap.keys():
        if m not in roop and countmap[m-1] != 0:
            num_until_r += 1
    
    k_r = k - num_until_r
    num_end = k_r%num_r

    if num_end == 0:
        print(next_city)
        
    else:
        print(teleport(next_city, num_end, roop))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

cnt = 1
ans =[0] * n

for _ in range(n):
    for i in range(n):
        if a[i] == cnt:
            ans[cnt-1] = i+1
            cnt += 1
            break

print(' '.join(map(str, ans)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
num = list(range(1, n+1))

cin = dict(zip(a, num))
ans =[]

for i in range(n):
    ans.append(cin[i+1])

print(' '.join(map(str, ans)))

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

cnt = 1
ans=[]
for _ in range(n):
    for i in range(n):
        if a[i] == cnt:
            ans.append(i+1)
            cnt += 1
            break

print(' '.join(map(str, ans)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
num = list(range(1, n+1))

cin = dict(zip(a, num))
ans =[]

for i in range(n):
    ans.append(cin[i+1])

print(' '.join(map(str, ans)))
Buggy python submission (verdict: Runtime Error):
import re

n = int(input())
v = sorted(list(map(int, input().split())))

ans = (v[0]+v[1])/2

if n == 2:
    ans = ans

elif n > 2 and n % 2 == 0:
    for i in range(n/2):
        ans = (ans + v[i+2])/2

else:
    for i in range(n-2):
        ans = (ans + v[i+2])/2

if re.search('.0', str(ans)):
    ans = str(ans).replace('.0', '')
    print(ans)

else:
    print(ans)

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

ans =v[0]

for i in range(n-1):
        ans = (ans + v[i+1])/2
print(ans)

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

n = int(input())
v = sorted(list(map(int, input().split())))

ans = (v[0]+v[1])/2

if n == 2:
    ans = str(ans)

elif n > 2 and n % 2 == 0:
    for i in range(n/2):
        ans = str((ans + v[i+2])/2)

else:
    for i in range(n-2):
        ans = str((ans + v[i+2])/2)

if re.search('.0', ans):
   ans = ans.replace('.0', '')
   print(ans)

else:
    print(ans)

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

ans =v[0]

for i in range(n-1):
        ans = (ans + v[i+1])/2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n = int(input())
sin = [''.join(sorted(input())) for _ in range(n)]

ans = []
combi_list =[]

for i in set(sin):
    if sin.count(i)  > 1:
        combi_list.append(sin.count(i))

for j in set(combi_list):
    x = list(itertools.combinations(range(j), 2))
    ans.append(len(x)*combi_list.count(j))

print(sum(ans))

Fixed submission:
from collections import Counter

n = int(input())
sin = [''.join(sorted(input())) for _ in range(n)]

ans = 0

for i in Counter(sin).values():
    ans += i*(i-1) //2
print(ans)

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

n = int(input())
sin = [''.join(sorted(input())) for _ in range(n)]

ans = []
combi =[]

for i in set(sin):
    if sin.count(i)  > 1:
        combi.append(sin.count(i))

for j in combi:
    x = list(itertools.combinations(range(j), 2))
    ans.append(len(x))

print(sum(ans))


Fixed submission:
from collections import Counter

n = int(input())
sin = [''.join(sorted(input())) for _ in range(n)]

ans = 0

for i in Counter(sin).values():
    ans += i*(i-1) //2
print(ans)

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

n = int(input())
sin = [''.join(sorted(input())) for _ in range(n)]

ans = []

for i in set(sin):
    if sin.count(i)  > 1:
        combi = list(itertools.combinations(range(sin.count(i)), 2))
        ans.append(len(combi))

print(sum(ans))


Fixed submission:
from collections import Counter

n = int(input())
sin = [''.join(sorted(input())) for _ in range(n)]

ans = 0

for i in Counter(sin).values():
    ans += i*(i-1) //2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]

for i in range(n):
    ans = a.copy()
    del ans[i]
    print(max(ans))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

comp = sorted(a, reverse = True)

Fmax = comp[0]
Smax = comp[1]

for i in range(n):
    if a[i] == Fmax:
        print(Smax)
    
    else:
        print(Fmax)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]

for i in range(n):
    ex = a.pop(i)
    print(max(a))
    a.insert(i, ex)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]

comp = sorted(a, reverse = True)

Fmax = comp[0]
Smax = comp[1]

for i in range(n):
    if a[i] == Fmax:
        print(Smax)
    
    else:
        print(Fmax)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

l = []
for _ in range(N):
  s = input()
  if l.count(s) == 0:
    l.append(s)

print(len(l))

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
  s = input()
  d[s]=0
  
print(len(d))
Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
ans = 0
for i in range(N):
for j in range(i, N):
if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
ans = max(ans, j - i + 1)
print(ans)

Fixed submission:
S = input()
N = len(S)
ans = 0
for i in range(N):
	for j in range(i, N):
		if all('ACGT'.count(c) == 1 for c in S[i : j + 1]):
			ans = max(ans, j - i + 1)
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
 print('Heisei' if S <= '2019/04/30' else 'TBD')

Fixed submission:
S = input()
print('Heisei' if S <= '2019/04/30' else 'TBD')

Buggy python submission (verdict: Runtime Error):
S = input()
2 print('Heisei' if S <= '2019/04/30' else 'TBD')

Fixed submission:
S = input()
print('Heisei' if S <= '2019/04/30' else 'TBD')

Buggy python submission (verdict: Runtime Error):
S = input()
2 print('Heisei' if S <= '2019/04/30' else 'TBD')

Fixed submission:
S = input()
print('Heisei' if S <= '2019/04/30' else 'TBD')

Buggy python submission (verdict: Runtime Error):
S = input()
2 print('Heisei' if S <= '2019/04/30' else 'TBD')

Fixed submission:
S = input()
print('Heisei' if S <= '2019/04/30' else 'TBD')
Buggy python submission (verdict: Runtime Error):
s = input()
if(s.length() != 6):
  print("No")

if(s[2] == s[3] && s[4] == s[5]):
  print("Yes")
else:
  print("No")

Fixed submission:
s = input()
 
if(s[2] == s[3] and s[4] == s[5]):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np

R = int(input())
print(R*2.*np.pi)


Fixed submission:
import numpy as np
 
R = int(input())
print(R*2.*np.pi)