Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
N=1000003
primes=[i for i in range(2,N+1)]
p=min(primes)
seen=[]
while p<N**0.5:
    i=2
    while p*i<N:
        if p*i in primes:
            primes.remove(p*i)
        i+=1
    seen.append(p)
    for i in primes:
        if i not in seen:
            p=i
    
for i in range(len(primes)):
    if primes[i]>x:
        ans=i
        break
print(primes[i])
    

Fixed submission:
x=int(input())

def is_prime(x):
    if x<=1:
        return False
    for i in range(2,int(x**0.5)):
        if x%i==0:
            return False
    return True

p=x
while not is_prime(p):
    p+=1
print(p)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S,T=input().split()
ans=str()
for i in range(N):
    ans+=S[i]
    ans+=T[j]


print(ans)

Fixed submission:
n = int(input())
s, t = input().split()

ans = str()
for i in range(n):
    ans += s[i]
    ans += t[i]

print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S,T=input().split()
ans=str()
for i in range(N):
    ans+=S[i]
    ans+=T[j]


print(ans)

Fixed submission:
n = int(input())
s, t = input().split()

ans = str()
for i in range(n):
    ans += s[i]
    ans += t[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
lcm=A*B/math.gcd(A,B)
print(int(lcm))

Fixed submission:
from fractions import gcd
A,B=map(int,input().split())
lcm=A*B/gcd(A,B)
print(int(lcm))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=input()
cnt=0
for i in range(1000):
    c=[i//100,(i//10)%10,i%10]
    f=0
    for j in range(N):
        if S[j]==str(c[f]):
            f+=1
        if (f==3):
            break
    if f==3:
        cnt+=1
print(cnt)    

Fixed submission:
N=int(input())
S=input()
cnt=0
for i in range(1000):
    c=[i//100,(i//10)%10,i%10]
    f=0
    for j in range(N):
        if S[j]==str(c[f]):
            f+=1
        if (f==3):
            break
    if f==3:
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
b=int(input())
s=input()

for i in s:
    b=a.index(i)+N
    if b<=25:
        print(a[b],end="")
    else:
        print(a[b-26],end="")

Fixed submission:
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
 
for i in S:
    b = a.index(i) + N
    if b <= 25:
        print(a[b], end="")
    else:
        print(a[b-26], end="")

Buggy python submission (verdict: Runtime Error):
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
b=int(input())
s=input()

for i in s:
    b=a.index(i)+N
    if b<=25:
        print(a[b],end="")
    else:
        print(a[b-26],end="")

Fixed submission:
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
 
for i in S:
    b = a.index(i) + N
    if b <= 25:
        print(a[b], end="")
    else:
        print(a[b-26], end="")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
B=[]*N
for i in range(1,N+1):
    print(A.index(i)+1,end=" ")

    

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
AA=[]
for i in range(N):
    AA.append([A[i],i+1])
AA.sort()
for j in range(N):
    print(AA[j][1],end=" ")

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

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
AA=[]
for i in range(N):
    AA.append([A[i],i+1])
AA.sort()
for j in range(N):
    print(AA[j][1],end=" ")
Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])

Fixed submission:
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)+1):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])

Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])

Fixed submission:
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)+1):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])

Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]

print(div[-K])

Fixed submission:
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)+1):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])

Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]

       
print(div[-K])

Fixed submission:
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)+1):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])
Buggy python submission (verdict: Runtime Error):
n=input()
for i in len(n):
    if(n[i]==1):
        n[i]=9
    else:
        n[i]=1
print(int(n))

Fixed submission:
n=input()
for i in n:
    if(i=="1"):
        print(9,end="")
    if(i=="9"):
        print(1,end="")
Buggy python submission (verdict: Runtime Error):
n=int(input())
A=sorted(list(map(int,input().split()),reverse=True)
print(sum(a[::2])-sum(a[1::2]))

Fixed submission:
n=int(input())
a = sorted(list(map(int,input().split())),reverse=True)
print(sum(a[::2])-sum(a[1::2]))
Buggy python submission (verdict: Runtime Error):
date = str(input())
date[3]="8"
print(date)

Fixed submission:
S = input()
print(S.replace("2017/","2018/",1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(len(set(map(int,[input() for i in range(n)])))

Fixed submission:
n = int(input())
print(len(set(map(int,[input() for i in range(n)]))))
Buggy python submission (verdict: Runtime Error):
input()
A=list(map(int,input().split())
count=0

while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count +=1
print(count)


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

while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count +=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())
ans=0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i+j+k==S:
                ans+=1

print(ans)

Fixed submission:
K,S=map(int,input().split())
ans=0
for i in range(K+1):
    for j in range(K+1):
        if  0<=S-i-j<=K:
            ans+=1

print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import deque
s=deque(list(input()))
p=deque()
for i in range(len(s)):
    w=s.popleft()
    if w=="0":
        p.append("0")
    elif w=="1":
        p.append("1")
    else:
        p.pop()
for i in range(len(p)):
    print(p[i],end="")
        




Fixed submission:
from collections import deque
s=deque(list(input()))
p=deque()
for i in range(len(s)):
    w=s.popleft()
    if w=="0":
        p.append("0")
    elif w=="1":
        p.append("1")
    else:
        if len(p)==0:
            continue
        else:
            p.pop()

for i in range(len(p)):
    print(p[i],end="")
Buggy python submission (verdict: Runtime Error):
import sys
 
n = sys.stdin.readline()
 
last = int(n[-1])
 
result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'
 
print(result)

Fixed submission:
n = input()
 
last = int(n[-1])
 
result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'
 
print(result)

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

n = sys.stdin.readline()

last = int(n[-1])

result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'

print(result)

Fixed submission:
n = input()
 
last = int(n[-1])
 
result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'
 
print(result)

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

n = sys.stdin.readline()

last = int(n[-1])

result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'

print(result)

Fixed submission:
n = input()
 
last = int(n[-1])
 
result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'
 
print(result)

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

n = sys.stdin.readline()

last = int(n[-1])

resutl = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon':
else:
    result = 'hon'

print(result)

Fixed submission:
n = input()
 
last = int(n[-1])
 
result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'
 
print(result)
Buggy python submission (verdict: Runtime Error):
import sys

k,s = map(int,sys.stdin.buffer.readline().split(' '))

result = 0

for x in range(k+1):
    for y in range(min(s-x+1,k+1)):
        z = s-x-y
        if z < 0: continue
        if z<=k:
            result+=1
        
print(result)

Fixed submission:
import sys

k,s = map(int,sys.stdin.readline().split(' '))

result = 0

for x in range(k+1):
    for y in range(min(s-x+1,k+1)):
        if (s-x-y)<=k:
            result+=1
        
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,K = list(map(int, input().split()))
count = 0

if A + B + C == K:
    print(A - C)

elif A > K:
    print(K)
elif A+B > K:
    print(A)
else:
    for i in reversed(range(0, K)):
        if A > 0:
            count += 1
            A = A - 1
        elif B > 0:
            B = B - 1
        else: 
            count -= 1

    print(count)

Fixed submission:
A,B,C,K = list(map(int, input().split()))
count = 0

if A + B + C == K:
    print(A - C)

elif A >= K:
    print(K)
elif A+B >= K:
    print(A)
else:
    t = K - A - B

    print(A - t)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,K = list(map(int, input().split()))
count = 0

if A + B + C == K:
    print(A - C)
else:
    for i in reversed(range(0, K)):
        if A > 0:
            count += 1
            A = A - 1
        elif B > 0:
            B = B - 1
        else: 
            count -= 1

    print(count)

Fixed submission:
A,B,C,K = list(map(int, input().split()))
count = 0

if A + B + C == K:
    print(A - C)

elif A >= K:
    print(K)
elif A+B >= K:
    print(A)
else:
    t = K - A - B

    print(A - t)
Buggy python submission (verdict: Runtime Error):
S = input().split()

if S == 'ARC':
    print('ABC')
elif S == 'ABC' 
    print('ARC')

Fixed submission:
S = input()

if S == 'ARC':
    print('ABC')
else:
    print('ARC')

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

if S == 'ARC':
    print('ABC')
elif S = 'ABC' 
    print('ARC')

Fixed submission:
S = input()

if S == 'ARC':
    print('ABC')
else:
    print('ARC')
Buggy python submission (verdict: Runtime Error):
N, = input().split()
A = input().split() 
ans = [0] * 2000001
for i in range(int(N) - 1):
    ans[int(A[i])] += 1
for i in range(1, int(N)+1):
    print(ans[i])

Fixed submission:
import math
R = input()
R = int(R)
R = R * 2 * math.pi

print(R)
Buggy python submission (verdict: Runtime Error):
N, = input().split()
A = input().split() 
ans = [0] * 200000
for i in range(int(N) - 1):
    ans[int(A[i])] += 1
for i in range(1, int(N)+1):
    print(ans[i])

Fixed submission:
N, = input().split()
A = input().split() 
ans = [0] * 2000001
for i in range(int(N) - 1):
    ans[int(A[i])] += 1
for i in range(1, int(N)+1):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
import math

from itertools import product
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)


a = input()
a = int(a)
count = 0
l = range(1, a + 1)
m = range(1, a + 1)
n = range(1, a + 1)

for x, y, z in product(l, m, n):
            count +=  gcd(x, y, z)

print(count)

Fixed submission:
import math


a = input()
a = int(a)
count = 0
for l in range(1, a + 1):
    for m in range(1, a + 1):
        x = math.gcd(l, m)
        for n in range(1, a + 1):
            count += math.gcd(x,n)

print(count)

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

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)


a = input()
a = int(a)
count = 0

for l in range(1, a + 1):
    for m in range(1, a + 1):
        for n in range(1, a + 1):
            count +=  gcd(l,m,n)

print(count)

Fixed submission:
import math


a = input()
a = int(a)
count = 0
for l in range(1, a + 1):
    for m in range(1, a + 1):
        x = math.gcd(l, m)
        for n in range(1, a + 1):
            count += math.gcd(x,n)

print(count)

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

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)


a = input()
a = int(a)
count = 0

for l in range(1, a + 1):
    for m in range(1, a + 1):
        for n in range(1, a + 1):
            count +=  gcd(l,m,n)

print(count)

Fixed submission:
import math


a = input()
a = int(a)
count = 0
for l in range(1, a + 1):
    for m in range(1, a + 1):
        x = math.gcd(l, m)
        for n in range(1, a + 1):
            count += math.gcd(x,n)

print(count)
Buggy python submission (verdict: Runtime Error):
import math
r = int(input)
print(math.pi*r*2)

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

Fixed submission:
from math import gcd
ans = 0
k = int(input())
 
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            ans += gcd(k,gcd(i,j))

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
ans = 0
k = int(input())

for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            gcd_1 = math.gcd(i,j)
            gcd_2 = math.gcd(gcd_1,k)
            ans += gcd_2
print(ans)

Fixed submission:
from math import gcd
ans = 0
k = int(input())
 
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            ans += gcd(k,gcd(i,j))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
import copy

n = int(input())
a = list(map(int,input().split()))

for i in range(n):
    tmp_l = copy.copy(a)
    tmp_l.pop(i)
    c = collections.Counter(tmp_l)
    tmp_ans = 0
    for v in c.values():
        tmp_ans += ((v*(v-1))//2)
#     ans.append(tmp_ans)
    print(tmp_ans)

Fixed submission:
from collections import Counter

n = int(input())
a = list(map(int, input().split()))

a_cnt = Counter(a)

x = 0
for i in a_cnt.values():
    x += i * (i - 1) // 2
    
for i in a:
    ans = x - (a_cnt[i] * (a_cnt[i] - 1) // 2)
    ans += (a_cnt[i]-1) * (a_cnt[i]-2) // 2
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
cnt = 0
boolean = True

while boolean:
    if n - a > 0:
        n -= a
        cnt += a
    else:
        cnt += n
        boolean = False
    if n - b > 0:
        n -= b
    else:
        boolean = False
print(cnt)

Fixed submission:
n,a,b = map(int,input().split())
ans = a*(n//(a+b))
if n % (a+b) < a:
    ans += n % (a+b)
else:
    ans += a
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
for i in range(q):
    tmp = list(map(str,input().split()))
    if tmp[0] == '2':
        if tmp[1] == '1':
            s = tmp[2] + s
        else:
            s = s + tmp[2]
    else:
        s = s[::-1]
print(s)

Fixed submission:
S = input()
Q = int(input())
A = [input().split() for i in range(Q)]

tmp = 0
s = S
t = ''

for li in A:
#     print(s,t,tmp)
    if li[0] == '1':
        tmp = (tmp+1)%2
    else:
        if (tmp+int(li[1]))%2 == 1:
            t += li[2]
        else:
            s += li[2]
            
if tmp == 0:
    print(t[::-1]+s)
else:
    print(s[::-1]+t)
Buggy python submission (verdict: Time Limit Exceeded):
import math

n,a,b = map(int,input().split())

ans = 0
mod = 10 ** 9 + 7

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1,n+1):
    if i != a and i != b:
        ans += combinations_count(n,i)

print(ans%mod)

Fixed submission:
n,a,b=map(int,input().split())
mod=10**9+7
def combination(p,k):
    a,b=1,1  
    for i in range(k):
        a*=(p-i)
        a%=mod
        b*=(i+1)
        b%=mod
    return (a*pow(b,mod-2,mod))%mod
print((pow(2,n,mod)-1-combination(n,a)-combination(n,b))%mod)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()
for i in range(k):
    if sum(h) == 0:
        break
    else:
        h.pop(-1)

print(sum(h))

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()
ans = 0

if n <= k:
    h.clear()
else:
    for i in range(k):
            h.pop(-1)

print(sum(h))
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
l = []
for i in range(m):
    p,s=map(str,input().split())
    l.append([int(p),s])

ac = 0 
wa = 0
    
for i in range(m):
    if l[i][1] == "WA":
        flag = True
        for j in range(0,i):
            if l[j][1] == "AC" and l[j][0] == l[i][0]:
                flag = False
                break
        if flag:
            wa += 1
        
    if l[i][1] == "AC":
        flag = True
        for j in range(0,i):
            if l[j][1] == "AC" and l[j][0] == l[i][0]:
                flag = False
                break
        if flag:
            ac += 1

print(ac,wa)

Fixed submission:
n,m = map(int, input().split())

a = [0]*n
b = [False]*n
for i in range(m):
    p,s = input().split()
    p = int(p) - 1
    if s == 'AC':
        b[p] = True
    elif b[p] == False:
        a[p] += 1

ac = b.count(True)
wa = 0
for i in range(n):
    if b[i] == True:
        wa += a[i]
print(ac,wa)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
l = []
for i in range(m):
    p,s=map(str,input().split())
    l.append([int(p),s])

ac = 0 
wa = 0
    
for i in range(m):
    if l[i][1] == "WA":
        flag = True
        for j in range(0,i):
            if l[j][1] == "AC" and l[j][0] == l[i][0]:
                flag = False
        if flag:
            wa += 1
        
    if l[i][1] == "AC":
        flag = True
        for j in range(0,i):
            if l[j][1] == "AC" and l[j][0] == l[i][0]:
                flag = False
        if flag:
            ac += 1

print(ac,wa)

Fixed submission:
n,m = map(int, input().split())

a = [0]*n
b = [False]*n
for i in range(m):
    p,s = input().split()
    p = int(p) - 1
    if s == 'AC':
        b[p] = True
    elif b[p] == False:
        a[p] += 1

ac = b.count(True)
wa = 0
for i in range(n):
    if b[i] == True:
        wa += a[i]
print(ac,wa)
Buggy python submission (verdict: Runtime Error):
from fractions import Fraction
a,b = map(int,input().split())

def lcm(x,y):
    return (x*y) // fractions.gcd(x,y)

print(lcm(a,b))


Fixed submission:
def gcd(a, b):
    if a < b :
        a, b = b, a
    while True:
        a, b = b, a % b
        if b == 0:
            return a
 
a, b = map(int, input().split())
print(int(a * b / gcd(a, b)))

Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())

def lcm(x,y):
    return (x*y) // math.gcd(x,y)

print(lcm(a,b))

Fixed submission:
def gcd(a, b):
    if a < b :
        a, b = b, a
    while True:
        a, b = b, a % b
        if b == 0:
            return a
 
a, b = map(int, input().split())
print(int(a * b / gcd(a, b)))
Buggy python submission (verdict: Runtime Error):
import fractions
a,b = map(int,input().split())

def lcm(x,y):
    return (x*y) // fractions.gcd(x,y)

print(lcm(a,b))


Fixed submission:
#11037751
N = int(input())
a = list(map(int,input().split()))
now = 1
cnt = 0
for i in range(N):
    if a[i]==now:
        now += 1
print(N-now+1 if now != 1 else -1)
Buggy python submission (verdict: Runtime Error):
#C
n = int(input())
h = list(map(int,input().split()))
dif = []

for i in range(len(h)-1):
    dif.append(h[i]-h[i+1])
cnt_list = []
for i in range(len(dif)):
    if dif[i] >= 0:
        cnt = 1
        for j in range(i+1,len(dif)):
            if dif[j] >= 0:
                cnt += 1
            else:
                break
    else:
        cnt = 0
    cnt_list.append(cnt)

print(max(cnt_list))

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
cnt = 0
max = 0

for i in range(1,len(h)):
    if h[i] <= h[i-1]:
        cnt+=1
        if cnt > max:
            max = cnt
    else:
        cnt = 0

print(max)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(n):
    ans += i
print(ans)

Fixed submission:
n = int(input())
ans = (n*(n-1))//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
n = int(input())
n_list = []
ans = 0
for i in range(1,n):
    ans += i
print(ans)

Fixed submission:
n = int(input())
ans = (n*(n-1))//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#d
import copy
n = int(input())
n_list = []
ans = 0
for i in range(1,n):
    ans += i
print(ans)

Fixed submission:
n = int(input())
ans = (n*(n-1))//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#d
import copy
n = int(input())
n_list = []
ans = 0
for i in range(1,n+1):
    n_list.append(i)
m_list = copy.copy(n_list)
tmp = m_list.pop(n-1)

print(sum(m_list))

Fixed submission:
n = int(input())
ans = (n*(n-1))//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
n = int(input())
n_list = []
ans = 0
for i in range(1,n+1):
    n_list.append(i)
m_list = copy.copy(n_list)
tmp = m_list.pop(0)
m_list.insert(n-1,tmp)
for i in range(len(n_list)):
    ans += n_list[i] % m_list[i]
print(ans)

Fixed submission:
n = int(input())
ans = (n*(n-1))//2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#C
import copy
n = int(input())
a = [int(input()) for _ in range(n)]
for i in range(n):
    tmp = copy.copy(a)
    tmp.pop(i)
    tmp.sort()
    print(tmp[-1])


Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
max_a = max(a)
max_idx = a.index(max_a)
for i in range(n):
    if i == max_idx:
        tmp = a
        tmp.sort(reverse=True)
        print(tmp[1])
    else:
        print(max_a)

Buggy python submission (verdict: Time Limit Exceeded):
#C
import copy
n = int(input())
a = [int(input()) for _ in range(n)]
for i in range(n):
    tmp = copy.copy(a)
    tmp.pop(i)
    print(max(tmp))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
max_a = max(a)
max_idx = a.index(max_a)
for i in range(n):
    if i == max_idx:
        tmp = a
        tmp.sort(reverse=True)
        print(tmp[1])
    else:
        print(max_a)

Buggy python submission (verdict: Time Limit Exceeded):
#C
import copy
n = int(input())
a = [int(input()) for _ in range(n)]
for i in range(n):
    tmp = copy.copy(a)
    tmp.pop(i)
    print(max(tmp))

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
max_a = max(a)
max_idx = a.index(max_a)
for i in range(n):
    if i == max_idx:
        tmp = a
        tmp.sort(reverse=True)
        print(tmp[1])
    else:
        print(max_a)
Buggy python submission (verdict: Runtime Error):
if A == 0 & B == 0:
    print('NA')
elif 1 <= A <= 12:
    if 1 <= B <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif 1 <= B <= 12:
    if 1 <= A <= 12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    print('NA')

Fixed submission:
S = input()

S_one = int(S[:2])
S_two = int(S[2:])

if S_one == 0:
    if 1 <= S_two <= 12:
        print('YYMM')
    else:
        print('NA')
elif 1 <= S_one <= 12:
    if 1 <= S_two <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= S_two <= 12:
        print('YYMM')
    else:
        print('NA')