Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def dfs(A,B):
    if len("".join(A))>10:
        return
    if int(A[-1]) == 0:
        for i in [0,1]:
            A.append(str(i))
            B.append("".join(A))
            dfs(A, B)
            A.pop()
    elif int(A[-1]) == 9:
        for i in [8,9]:
            A.append(str(i))
            B.append("".join(A))
            dfs(A, B)
            A.pop()
    else:
        for i in range(int(A[-1])-1,int(A[-1])+2):
            A.append(str(i))
            B.append("".join(A))
            dfs(A,B)
            A.pop()

if __name__ == "__main__":
    k=int(input())
    ans_list=[]
    num_list=[]
    for i in range(1,10):
        ans_list.append(str(i))
        num_list.append(str(i))
        dfs(num_list,ans_list)
        num_list.clear()
    ans_list=sorted(ans_list,key=int)
    print(ans_list[k-1])



Fixed submission:
def dfs(A,B):
    if len("".join(A))>10:
        return
    if int(A[-1]) == 0:
        for i in [0,1]:
            A.append(str(i))
            B.append("".join(A))
            dfs(A, B)
            A.pop()
    elif int(A[-1]) == 9:
        for i in [8,9]:
            A.append(str(i))
            B.append("".join(A))
            dfs(A, B)
            A.pop()
    else:
        for i in range(int(A[-1])-1,int(A[-1])+2):
            A.append(str(i))
            B.append("".join(A))
            dfs(A,B)
            A.pop()

if __name__ == "__main__":
    k=int(input())
    ans_list=[]
    num_list=[]
    for i in range(1,10):
        ans_list.append(str(i))
        num_list.append(str(i))
        dfs(num_list,ans_list)
        num_list.clear()
    ans_list=sorted(ans_list,key=int)
    print(ans_list[k-1])
Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb


if __name__ == "__main__":
    n, a, b = map(int, input().split())
    ans=0
    if n == 2:
        if (a == 1 and b == 1) or (a == 2 and b == 1):
            print(0)
    else:
        for i in range(1, int(n // 2)):
            cnt=2
            if i == a or i == b:
                cnt -= 1
            if (n - i) == a or (n - i) == b:
                cnt -= 1
            ans += comb(n,i,exact=True)*cnt
        if n%2==0 and (int(n//2) !=a and int(n//2) != b):
            ans += comb(n,int(n//2),exact=True)
        if n != a and n != b:
            ans += 1
        print(ans % (10 ** 9 + 7))

Fixed submission:
n,a,b=map(int,input().split())
MOD=10**9+7
total=(pow(2,n,MOD)-1)%MOD
na=1
nb=1
atotal=1
btotal=1
for i in range(a):
    na=(na*(n-i))%MOD
for i in range(b):
    nb=(nb*(n-i))%MOD
for i in range(1,a+1):
    atotal=(atotal*i)%MOD
for i in range(1, b + 1):
    btotal = (btotal * i) % MOD
atotal=pow(atotal,MOD-2,MOD)%MOD
btotal=pow(btotal,MOD-2,MOD)%MOD
ans=total%MOD-(na*atotal)%MOD-(nb*btotal)%MOD
print(ans%MOD)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import heapq

n=int(input())
word=[]
for i in range(n):
    word.append(input())

word_count=Counter(word)

ans=[k for k, v in word_count.items() if v == max(word_count.values())]
cnt=len(ans)
heapq.heapify(ans)
for i in range(cnt):
    print(heapq.heappop(ans))


Fixed submission:
from collections import Counter
import heapq

n=int(input())
word=[]
for i in range(n):
    word.append(input())

word_count=Counter(word)
ma=max(word_count.values())

ans=[k for k, v in word_count.items() if v == ma]
cnt=len(ans)
heapq.heapify(ans)
for i in range(cnt):
    print(heapq.heappop(ans))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import heapq

n=int(input())
word=[]
for i in range(n):
    word.append(input())

word_count=Counter(word)

ans=[k for k, v in word_count.items() if v == max(word_count.values())]
cnt=len(ans)
heapq.heapify(ans)
for i in range(cnt):
    print(heapq.heappop(ans))

Fixed submission:
from collections import Counter
import heapq

n=int(input())
word=[]
for i in range(n):
    word.append(input())

word_count=Counter(word)
ma=max(word_count.values())

ans=[k for k, v in word_count.items() if v == ma]
cnt=len(ans)
heapq.heapify(ans)
for i in range(cnt):
    print(heapq.heappop(ans))

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

n=int(input())
word={}

for i in range(n):
    tmpword=input()
    if tmpword in word:
        word[tmpword] = word[tmpword]+1
    else:
        word[tmpword] = 1


#ans.append(max(word.items(),key=lambda x:x[1])[0])
ans=[k for k, v in word.items() if v == max(word.values())]
cnt=len(ans)
heapq.heapify(ans)
for i in range(cnt):
    print(heapq.heappop(ans))

Fixed submission:
from collections import Counter
import heapq

n=int(input())
word=[]
for i in range(n):
    word.append(input())

word_count=Counter(word)
ma=max(word_count.values())

ans=[k for k, v in word_count.items() if v == ma]
cnt=len(ans)
heapq.heapify(ans)
for i in range(cnt):
    print(heapq.heappop(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
word={}

for i in range(n):
    tmpword=input()
    if tmpword in word:
        word[tmpword] = word[tmpword]+1
    else:
        word[tmpword] = 1


#ans.append(max(word.items(),key=lambda x:x[1])[0])
ans=[k for k, v in word.items() if v == max(word.values())]
ans.sort()
for i in ans:
    print(i)

Fixed submission:
from collections import Counter
import heapq

n=int(input())
word=[]
for i in range(n):
    word.append(input())

word_count=Counter(word)
ma=max(word_count.values())

ans=[k for k, v in word_count.items() if v == ma]
cnt=len(ans)
heapq.heapify(ans)
for i in range(cnt):
    print(heapq.heappop(ans))
Buggy python submission (verdict: Time Limit Exceeded):
def EV(num):
    sum=0
    for j in range(1,num+1):
        sum+=j
    return sum/num

if __name__=="__main__":
    n,k=map(int,input().split())
    p=list(map(int,input().split()))

    exp={}

    ans=0
    cnt=0

    for j in range(0,n-k+1):

        tmp=0
        for i in range(k):
            if p[i+cnt] not in exp:
                exp[p[i+cnt]] = EV(p[i+cnt])
            tmp+=exp[p[i+cnt]]
        if ans < tmp:
            ans=tmp
        cnt += 1

    print(ans)

Fixed submission:
from itertools import accumulate

n,k=map(int,input().split())
p=list(map(int,input().split()))

exp={}
cum=[]

ans=0
cnt=0
for i in range(1,1001):
    sum=0
    for j in range(1,i+1):
        sum+=j
    exp[i]=sum/i

for i in p:
    cum.append(exp[i])

cumsum=list(accumulate(cum))
cumsum.insert(0,0)

for i in range(n-k+1):
    tmp = cumsum[i+k] - cumsum[i]
    if ans <= tmp:
        ans = tmp

print(ans)

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

n,k=map(int,input().split())
p=list(map(int,input().split()))

exp={}

ans=0
cnt=0
for i in range(1,1001):
    sum=0
    for j in range(1,i+1):
        sum+=j
    exp[i]=sum/i

for j in range(n-k+1):
    tmp=0
    for i in range(k):
        tmp+=exp[p[i+cnt]]
    if ans < tmp:
        ans=tmp
    cnt += 1

print(ans)


Fixed submission:
from itertools import accumulate

n,k=map(int,input().split())
p=list(map(int,input().split()))

exp={}
cum=[]

ans=0
cnt=0
for i in range(1,1001):
    sum=0
    for j in range(1,i+1):
        sum+=j
    exp[i]=sum/i

for i in p:
    cum.append(exp[i])

cumsum=list(accumulate(cum))
cumsum.insert(0,0)

for i in range(n-k+1):
    tmp = cumsum[i+k] - cumsum[i]
    if ans <= tmp:
        ans = tmp

print(ans)

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

exp={}

ans=0
cnt=0
for i in range(1,1001):
    sum=0
    for j in range(1,i+1):
        sum+=j
    exp[i]=sum/i

while cnt<=n-k:
    tmp=0
    for i in range(k):
        tmp+=exp[p[i+cnt]]
    if ans < tmp:
        ans=tmp
    cnt += 1

print(ans)

Fixed submission:
from itertools import accumulate

n,k=map(int,input().split())
p=list(map(int,input().split()))

exp={}
cum=[]

ans=0
cnt=0
for i in range(1,1001):
    sum=0
    for j in range(1,i+1):
        sum+=j
    exp[i]=sum/i

for i in p:
    cum.append(exp[i])

cumsum=list(accumulate(cum))
cumsum.insert(0,0)

for i in range(n-k+1):
    tmp = cumsum[i+k] - cumsum[i]
    if ans <= tmp:
        ans = tmp

print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools
import math
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
sample=[]
for i in range(1,n+1):
    sample.append(i)
perm=list(itertools.permutations(sample))
for i in range(math.factorial(n)):
    perm[i]=list(perm[i])
ans=[]
for i in range(math.factorial(n)):
    if list(perm[i]) == p or list(perm[i]) == q :
        ans.append(i+1)
        if len(ans) == 2:
            break

print(abs(ans[1]-ans[0]))


Fixed submission:
import itertools
import math
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
if p== q:
    print(0)
else:
    sample=[]
    for i in range(1,n+1):
        sample.append(i)
    perm=list(itertools.permutations(sample))
    for i in range(math.factorial(n)):
        perm[i]=list(perm[i])
    ans=[]
    for i in range(math.factorial(n)):
        if list(perm[i]) == p or list(perm[i]) == q :
            ans.append(i+1)
            if len(ans) == 2:
                break

    print(abs(ans[1]-ans[0]))
Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
for i in range(int(math.sqrt(n)),n+1):
    if n%i == 0:
        a=int(n/i)-1
        b=i-1
        break
    else:
        continue
print(a+b)



Fixed submission:
import math

ans=1000000000000000
n=int(input())
for i in range(1,int(math.sqrt(n))+2):
    if n%i==0:
        tmp = (i-1)+(int(n//i)-1)
        ans = min(tmp,ans)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(1,n+1):
    ans.append(str(a.index(i)+1))
ans=' '.join(ans)
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans={}
for i in range(1,n+1):
    ans[a[i-1]]=i
answer=[]
for i in range(1,n+1):
    answer.append(str(ans[i]))
answer=' '.join(answer)
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b=map(int,input().split())
Cdiv=[]
ans=[]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        Cdiv.append(i)
for i in reversed(Cdiv):
    flag=0
    for j in range(2,1+int(math.sqrt(int(i)))):
        if i%j==0:
            flag+=1
            break
    if flag==0:
        ans.append(i)

print(len(ans))

Fixed submission:
import fractions

A,B = map(int, input().strip().split(' '))

# 素因数分解
def trial_division(n):
  result = []
  while n % 2 == 0:
    result.append(2)
    n //= 2
  f = 3
  while f*f <= n:
    if n % f == 0:
      result.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    result.append(n)
  return result

gcd_ = fractions.gcd(A,B)
if gcd_ == 1:
  print(1)
else:
  print(len(set(trial_division(gcd_)))+1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
Cdiv=[]
ans=[]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        Cdiv.append(i)
for i in reversed(Cdiv):
    flag=0
    for j in range(2,i):
        if i%j==0:
            flag+=1
            break
    if flag==0:
        ans.append(i)

print(len(ans))

Fixed submission:
import fractions

A,B = map(int, input().strip().split(' '))

# 素因数分解
def trial_division(n):
  result = []
  while n % 2 == 0:
    result.append(2)
    n //= 2
  f = 3
  while f*f <= n:
    if n % f == 0:
      result.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    result.append(n)
  return result

gcd_ = fractions.gcd(A,B)
if gcd_ == 1:
  print(1)
else:
  print(len(set(trial_division(gcd_)))+1)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

s=stdin.readline().rstrip().split()
N=int(s[0])
M=int(s[1])
count=0

a=stdin.readline().rstrip().split()
for i in range(N):
  a[i]=int(a[i])

for i in range(M):
  a[a.index(max(a))]=a[a.index(max(a))]//2

print(sum(a))


Fixed submission:
from sys import stdin
import heapq

s=stdin.readline().rstrip().split()
N=int(s[0])
M=int(s[1])

a=stdin.readline().rstrip().split()
for i in range(N):
  a[i]=int(a[i])*(-1)
  
heapq.heapify(a)
for i in range(M):
  t=-(-heapq.heappop(a)//2)
  heapq.heappush(a,t)
print(sum(a)*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

s=stdin.readline().rstrip().split()
N=int(s[0])
M=int(s[1])
count=0
total=0

a=stdin.readline().rstrip().split()
for i in range(N):
  a[i]=int(a[i])

for i in range(M):
  a[a.index(max(a))]=a[a.index(max(a))]//2

for i in range(N):
  total=total+a[i]
  
print(total)

Fixed submission:
from sys import stdin
import heapq

s=stdin.readline().rstrip().split()
N=int(s[0])
M=int(s[1])

a=stdin.readline().rstrip().split()
for i in range(N):
  a[i]=int(a[i])*(-1)
  
heapq.heapify(a)
for i in range(M):
  t=-(-heapq.heappop(a)//2)
  heapq.heappush(a,t)
print(sum(a)*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
s=list(input().split())
N=int(s[0])
M=int(s[1])
count=0
total=0
a = list(input().split())
for i in range(N):
  a[i]=int(a[i])
while(count<M):
  a[a.index(max(a))]=a[a.index(max(a))]//2
  count+=1

for i in range(N):
  total=total+a[i]
  
print(total)
  

Fixed submission:
from sys import stdin
import heapq

s=stdin.readline().rstrip().split()
N=int(s[0])
M=int(s[1])

a=stdin.readline().rstrip().split()
for i in range(N):
  a[i]=int(a[i])*(-1)
  
heapq.heapify(a)
for i in range(M):
  t=-(-heapq.heappop(a)//2)
  heapq.heappush(a,t)
print(sum(a)*(-1))

Buggy python submission (verdict: Time Limit Exceeded):
s=list(input().split())
N=int(s[0])
M=int(s[1])
count=0
total=0
a = list(map(int,input().split()))	
while(count<M):
  a[a.index(max(a))]=a[a.index(max(a))]//2
  count+=1

for i in range(N):
  total=total+a[i]
  
print(total)

Fixed submission:
from sys import stdin
import heapq

s=stdin.readline().rstrip().split()
N=int(s[0])
M=int(s[1])

a=stdin.readline().rstrip().split()
for i in range(N):
  a[i]=int(a[i])*(-1)
  
heapq.heapify(a)
for i in range(M):
  t=-(-heapq.heappop(a)//2)
  heapq.heappush(a,t)
print(sum(a)*(-1))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
 
s,t =input().split()
count=int(s)
goal=int(t)
total=count
cnt=1
if goal==1:
  cnt=0
else:
	while total<goal :
 	  total=total+count-1
	  cnt+=1
  
print(cnt)

Fixed submission:
from sys import stdin
 
s,t =input().split()
count=int(s)
goal=int(t)
total=count
cnt=1

while total<goal :
	total=total+count-1
	cnt+=1

if goal==1:
  cnt=0
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
elif n==2:
    if xlist[0]>=xlist[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
        else:
            maxlen.append(count)
            count = 0
    print(max(max(maxlen), count))










Fixed submission:
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
elif n==2:
    if xlist[0]>=xlist[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
            if i==n-2:
                maxlen.append(count)
        else:
            maxlen.append(count)
            count = 0
    print(max(maxlen))

Buggy python submission (verdict: Runtime Error):
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
        else:
            maxlen.append(count)
            count = 0
    print(max(max(maxlen), count))










Fixed submission:
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
elif n==2:
    if xlist[0]>=xlist[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
            if i==n-2:
                maxlen.append(count)
        else:
            maxlen.append(count)
            count = 0
    print(max(maxlen))

Buggy python submission (verdict: Runtime Error):
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
        else:
            maxlen.append(count)
            count = 0

print(max(max(maxlen),count))








Fixed submission:
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
elif n==2:
    if xlist[0]>=xlist[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
            if i==n-2:
                maxlen.append(count)
        else:
            maxlen.append(count)
            count = 0
    print(max(maxlen))

Buggy python submission (verdict: Runtime Error):
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
for i in range(n-1):
    if xlist[i]>=xlist[i+1]:
        count+=1
    else:
        maxlen.append(count)
        count=0
print(max(max(maxlen),count))








Fixed submission:
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
elif n==2:
    if xlist[0]>=xlist[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
            if i==n-2:
                maxlen.append(count)
        else:
            maxlen.append(count)
            count = 0
    print(max(maxlen))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
word=[]
word_lst=[]
for i in range(N):
  s=input()
  word.append(s)
  word_lst.append(list(word[i]))
  word_lst[i].sort()
  word_lst[i]=''.join(word_lst[i])

count=0
for i in range(N):
  flag = 0
  for j in range(N):
    if flag == 1:
      pass
    if word_lst[i]==word_lst[j]:
      count=count+1
      flag =flag+1

total=int((count-N)/2)
  
  
print(total)  


Fixed submission:
import collections

n=int(input())
s=[]
set={}
for i in range(n):
    s.append(input())
for i in range(n):
    temp=list(s[i])
    temp.sort()
    s[i]=''.join(temp)
count=0
ans=collections.Counter(s)
countlist=ans.most_common()
for i in range(len(countlist)):
    if countlist[i][1]<=1:
        break
    else:
        temp=countlist[i][1]-1
        count+=(temp+1)*temp//2

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
word=[]
word_lst=[]
for i in range(N):
  s=input()
  word.append(s)
  word_lst.append(list(word[i]))
  word_lst[i].sort()
  word_lst[i]=''.join(word_lst[i])

count=0
for i in range(N):
  for j in range(N):
    if word_lst[i]==word_lst[j]:
      count=count+1

total=int((count-N)/2)
  
  
print(total)  


Fixed submission:
import collections

n=int(input())
s=[]
set={}
for i in range(n):
    s.append(input())
for i in range(n):
    temp=list(s[i])
    temp.sort()
    s[i]=''.join(temp)
count=0
ans=collections.Counter(s)
countlist=ans.most_common()
for i in range(len(countlist)):
    if countlist[i][1]<=1:
        break
    else:
        temp=countlist[i][1]-1
        count+=(temp+1)*temp//2

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
word=[]
word_lst=[]
for i in range(N):
  s=input()
  word.append(s)
  word_lst.append(list(word[i]))
  word_lst[i].sort()
  word_lst[i]=''.join(word_lst[i])

count=0
for i in range(N):
  for j in range(N):
    if word_lst[i]==word_lst[j]:
      count=count+1

total=int((count-N)/2)
  
  
print(total)  


Fixed submission:
import collections

n=int(input())
s=[]
set={}
for i in range(n):
    s.append(input())
for i in range(n):
    temp=list(s[i])
    temp.sort()
    s[i]=''.join(temp)
count=0
ans=collections.Counter(s)
countlist=ans.most_common()
for i in range(len(countlist)):
    if countlist[i][1]<=1:
        break
    else:
        temp=countlist[i][1]-1
        count+=(temp+1)*temp//2

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
word=[]
word_lst=[]
for i in range(N):
  s=input()
  word.append(s)
  word_lst.append(list(word[i]))
  word_lst[i].sort()

count=0
for i in range(N):
  for j in range(N):
    if word_lst[i]==word_lst[j]:
      count=count+1

total=int((count-N)/2)
  
  
print(total)  


Fixed submission:
import collections

n=int(input())
s=[]
set={}
for i in range(n):
    s.append(input())
for i in range(n):
    temp=list(s[i])
    temp.sort()
    s[i]=''.join(temp)
count=0
ans=collections.Counter(s)
countlist=ans.most_common()
for i in range(len(countlist)):
    if countlist[i][1]<=1:
        break
    else:
        temp=countlist[i][1]-1
        count+=(temp+1)*temp//2

print(count)
Buggy python submission (verdict: Runtime Error):
from sys import stdin

param = input().split()
A=param[0]
B=param[1]
C=param[2]

hituyou=A-B
if hituyou<=C :
  nokori = C-hituyou
elif hituyou>C:
  nokori = 0
  
print(nokori)

Fixed submission:
from sys import stdin

param = input().split()
A=int(param[0])
B=int(param[1])
C=int(param[2])

hituyou=A-B
if hituyou<=C :
  nokori = C-hituyou
elif hituyou>C:
  nokori = 0
  
print(nokori)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
for i in range(n):
   a.append(int(input()))
temp=max(a)
for i in range(n):
    if a[i]<temp:
        print(temp)
    else:
        temp2=a.pop(i)
        print(max(a))
        a.insert(i,temp2)

Fixed submission:
n=int(input())
a=[]
for i in range(n):
   a.append(int(input()))
b=sorted(a,reverse=True)
tempa=b[0]
tempb=b[1]
for i in range(n):
    if a[i]<tempa:
        print(tempa)
    else:
        print(tempb)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n=int(input())
a=[]
for i in range(n):
   a.append(int(input()))
q=deque(a)
for i in range(n):
    temp=q.popleft()
    print(max(q))
    q.append(temp)


Fixed submission:
n=int(input())
a=[]
for i in range(n):
   a.append(int(input()))
b=sorted(a,reverse=True)
tempa=b[0]
tempb=b[1]
for i in range(n):
    if a[i]<tempa:
        print(tempa)
    else:
        print(tempb)
Buggy python submission (verdict: Runtime Error):
import sys
try:
    while True:
        n = input()
        a=input()
		b=input()
		nn=int(n)
		aa=int(a)
		bb=int(b)
        if n == '':
            break
        if a == '':
            break
        if b == '':
            break
except EOFError:
    pass

train=nn*aa
taxi=bb
if train>=taxi:
  print(train)
else:
  print(taxi)


Fixed submission:
import sys

n,a,b=(int(x) for x in input().split())

train=n*a
taxi=b
if train>=taxi:
  print(taxi)
else:
  print(train)

Buggy python submission (verdict: Runtime Error):
import sys
n=input()
a=input()
b=input()
nn=int(n)
aa=int(a)
bb=int(b)

train=nn*aa
taxi=bb
if train>=taxi:
  print(train)
else:
  print(taxi)


Fixed submission:
import sys

n,a,b=(int(x) for x in input().split())

train=n*a
taxi=b
if train>=taxi:
  print(taxi)
else:
  print(train)

Buggy python submission (verdict: Runtime Error):
import sys
n=input()
a=input()
b=input()
nn=int(n)
aa=int(a)
bb=int(b)

train=nn*aa
taxi=bb
if train>=taxi:
  print(train)
else:
  print(taxi)


Fixed submission:
import sys

n,a,b=(int(x) for x in input().split())

train=n*a
taxi=b
if train>=taxi:
  print(taxi)
else:
  print(train)

Buggy python submission (verdict: Runtime Error):
import sys
n=input()
a=input()
b=input()
train=int(n)*int(a)
taxi=int(b)
if train>=taxi:
  print(train)
else:
  print(taxi)


Fixed submission:
import sys

n,a,b=(int(x) for x in input().split())

train=n*a
taxi=b
if train>=taxi:
  print(taxi)
else:
  print(train)

Buggy python submission (verdict: Runtime Error):
import sys
n=input()
a=input()
b=input()
train=n*a
taxi=b
if train>=taxi:
  print(train)
else:
  print(taxi)

Fixed submission:
import sys

n,a,b=(int(x) for x in input().split())

train=n*a
taxi=b
if train>=taxi:
  print(taxi)
else:
  print(train)