Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for i in range(N)]
print(len([x for x in set(A) if A.count(x)%2==1]))

Fixed submission:
import collections as co
N = int(input())
A = [int(input()) for i in range(N)]
c = co.Counter(A)
count = 0
for a,b in c.most_common():
    if b%2==1:
        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
li = []
for i in range(N):
    A = int(input())
    if A not in li:
        li.append(A)
    elif A in li:
        li.remove(A)
print(len(li))

Fixed submission:
import collections as co
N = int(input())
A = [int(input()) for i in range(N)]
c = co.Counter(A)
count = 0
for a,b in c.most_common():
    if b%2==1:
        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N =  int(input())
A = [int(input()) for i in range(N)]
li = list(set(A))
count = 0
for i in range(len(li)):
    if A.count(li[i])%2!=0:
        count += 1
print(count)

Fixed submission:
import collections as co
N = int(input())
A = [int(input()) for i in range(N)]
c = co.Counter(A)
count = 0
for a,b in c.most_common():
    if b%2==1:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import collections
N =  int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)
a = sorted(a.items())
li = [0]*N
tmp = 0
if N==1:
    print(1)
    exit()

for i in range(len(a)-1):
    tmp += a[i][1]
    if a[i][0]-1==a[i-1][0]:
        tmp += a[i-1][1]
    if a[i][0]+1==a[i+1][0]:
        tmp += a[i+1][1]
    li[i] = tmp
    tmp = 0

if a[-1][0]-1==a[-2][0]:
    li.append(a[-1][1]+a[-2][1])
print(max(li))

Fixed submission:
import collections
N =  int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)
a = sorted(a.items())
li = [0]*N
tmp = 0
if len(a)==1:
    print(a[0][1])
    exit()

for i in range(len(a)-1):
    tmp += a[i][1]
    if a[i][0]-1==a[i-1][0]:
        tmp += a[i-1][1]
    if a[i][0]+1==a[i+1][0]:
        tmp += a[i+1][1]
    li[i] = tmp
    tmp = 0

if a[-1][0]-1==a[-2][0]:
    li.append(a[-1][1]+a[-2][1])
print(max(li))

Buggy python submission (verdict: Runtime Error):
import collections
N =  int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)
a = sorted(a.items())
li = [0]*N
tmp = 0
if N==1:
    print(1)
    exit()

for i in range(len(a)-1):
    tmp += a[i][1]
    if a[i][0]-1==a[i-1][0]:
        tmp += a[i-1][1]
    if a[i][0]+1==a[i+1][0]:
        tmp += a[i+1][1]
    li[i] = tmp
    tmp = 0
if a[-1][0]-1==a[-2][0]:
    li[-1] = a[-1][1]+a[-2][1]
print(max(li))

Fixed submission:
import collections
N =  int(input())
a = list(map(int,input().split()))
a = collections.Counter(a)
a = sorted(a.items())
li = [0]*N
tmp = 0
if len(a)==1:
    print(a[0][1])
    exit()

for i in range(len(a)-1):
    tmp += a[i][1]
    if a[i][0]-1==a[i-1][0]:
        tmp += a[i-1][1]
    if a[i][0]+1==a[i+1][0]:
        tmp += a[i+1][1]
    li[i] = tmp
    tmp = 0

if a[-1][0]-1==a[-2][0]:
    li.append(a[-1][1]+a[-2][1])
print(max(li))
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int,input().split()))

now = count = 0
while(now<N):
    if p[now]==now+1:
        tmp = p[now]
        p[now] = p[now+1]
        p[now+1] = tmp
        now -= 1
        count += 1
        continue
    now += 1
print(count)



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

now = count = 0
while(now<N):
    if p[now]==now+1:
        if now+1 != N:
            tmp = p[now]
            p[now] = p[now+1]
            p[now+1] = tmp
            now -= 1
            count += 1
            continue
        else:
            tmp = p[now]
            p[now] = p[now-1]
            p[now-1] = tmp
            now -= 1
            count += 1
            continue
    now += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = list(set(A))
li = []
for i in B:
    tmp = A.count(i)
    if tmp>1:
        for j in range(tmp//2):
            li.append(i)
li.sort()
if len(li)>1:
    print(li[-1]*li[-2])
else:
    print(0)

Fixed submission:
import collections
N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A)
C = [i[0] for i in B.items() if i[1] >= 2]
D = [i[0] for i in B.items() if i[1] >= 4]
C.sort(reverse=True)
D.sort(reverse=True)
if len(C)==0 or len(C)==1 and len(D)==0:
    print(0)
elif len(C)>1 and len(D)==0:
    print(C[0]*C[1])
elif len(C)==0 and len(D)>0:
    print(D[0]*2)
elif len(C)==1 and len(D)>0:
    print(max(C[0]*D[0],D[0]*2))
else:
    print(max(D[0]*2,C[0]*C[1],C[0]*D[0]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = [int(input()) for i in range(N)]
T.sort()
while True:
    flag = False
    for i in range(N-1):
        if T[-1]%T[i]!=0:
            T[-1] += T[-1]
            flag = True
            break
    if flag == False:
        print(T[-1])
        break


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

def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)

for i in range(N):
    ans = (ans*T[i])//gcd(ans,T[i])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N,P = map(int,input().split())
A = list(map(int,input().split()))
even = [a for a in A if a%2==0]
odd = [a for a in A if a%2==1]
li0 = []
li1 = []
ans = 0
if P==0:
    for _ in range(0,len(odd)+1,2):
        li0.append(len(list(itertools.combinations(odd,_))))
    for i in range(len(even)+1):
        tmp = len(list(itertools.combinations(even,i)))
        for j in li0:
            ans += tmp*j
else:
    for _ in range(len(even)+1):
        li1.append(len(list(itertools.combinations(even,_))))
    for i in range(1,len(odd)+1,2):
        tmp = len(list(itertools.combinations(odd,i)))
        for j in li1:
            ans += tmp*j
print(ans)


Fixed submission:
N,P = map(int,input().split())
A = list(map(int,input().split()))
for i in A:
    if i%2==1:
        print(2**(N-1))
        exit()
print(0 if P==1 else 2**N)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N,P = map(int,input().split())
A = list(map(int,input().split()))
even = [a for a in A if a%2==0]
odd = [a for a in A if a%2==1]
ans = 0
if P==0:
    for i in range(len(even)+1):
        tmp1 = len(list(itertools.combinations(even,i)))
        for j in range(0,len(odd)+1,2):
            tmp2 = len(list(itertools.combinations(odd,j)))
            ans += tmp1*tmp2
else:
    for i in range(1,len(odd)+1,2):
        tmp1 = len(list(itertools.combinations(odd,i)))
        for j in range(len(even)+1):
            tmp2 = len(list(itertools.combinations(even,j)))
            ans += tmp1*tmp2
print(ans)

Fixed submission:
N,P = map(int,input().split())
A = list(map(int,input().split()))
for i in A:
    if i%2==1:
        print(2**(N-1))
        exit()
print(0 if P==1 else 2**N)
Buggy python submission (verdict: Runtime Error):
r,g,b = map(int,input().split())
num = r*100+g*10+b
if (num%4=0):
    print("YES")
else:
    print("NO")

Fixed submission:
r,g,b = map(int,input().split())
num = r*100+g*10+b
if (num%4==0):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
count = 0
while True:
    a,b = map(int,input().split())
    count += b
    if count > K:
        print(a)
        exit()

Fixed submission:
N, K = map(int,input().split())
li = []
count = 0
for i in range(N):
    a,b = map(int,input().split())
    li.append([a,b])
li.sort()
for j in range(N):
    count += li[j][1]
    if count >= K:
        print(li[j][0])
        break
Buggy python submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    #divisors.sort()
    return divisors

N = int(input())
list =  make_divisors(N)
ans = 10**9
for i in range(0,len(list),2):
  tmp1 = len(str(list[i]))
  tmp2 = len(str(list[i+1]))
  ans = min(ans,max(tmp1,tmp2))
print(ans)


Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    #divisors.sort()
    return divisors

N = int(input())
list =  make_divisors(N)
ans = 10**9
if len(list)%2==1:
    list.append(list[-1])
for i in range(0,len(list),2):
    tmp1 = len(str(list[i]))
    tmp2 = len(str(list[i+1]))
    ans = min(ans,max(tmp1,tmp2))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def prime_factor(n):
    factors = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0:
            factors.append(i)
            n = n//i
    if n!=1:
        factors.append(n)
    return factors

N = int(input())
li = prime_factor(N)
a = len(li)
ans = 10**9
for i in range(2**a):
    tmp1 = tmp2 = 1
    for j in range(a):
        if ((i>>j) & 1):
            tmp1 *= li[j]
        else:
            tmp2 *= li[j]
    tmp3 = max(len(str(tmp1)),len(str(tmp2)))
    if ans>tmp3:
        ans = tmp3
print(ans)

Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    #divisors.sort()
    return divisors

N = int(input())
list =  make_divisors(N)
ans = 10**9
if len(list)%2==1:
    list.append(list[-1])
for i in range(0,len(list),2):
    tmp1 = len(str(list[i]))
    tmp2 = len(str(list[i+1]))
    ans = min(ans,max(tmp1,tmp2))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def prime_factor(n):
    factors = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0:
            factors.append(i)
            n = n//i
    if n!=1:
        factors.append(n)
    return factors

N = int(input())
li = prime_factor(N)
a = len(li)
ans = []
for i in range(2**a):
    tmp1 = 1
    tmp2 = 1
    for j in range(a):
        if ((i >> j) & 1):
            tmp1 *= li[j]
        else:
            tmp2 *= li[j]
    ans.append(max(len(str(tmp1)),len(str(tmp2))))
print(min(ans))

Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    #divisors.sort()
    return divisors

N = int(input())
list =  make_divisors(N)
ans = 10**9
if len(list)%2==1:
    list.append(list[-1])
for i in range(0,len(list),2):
    tmp1 = len(str(list[i]))
    tmp2 = len(str(list[i+1]))
    ans = min(ans,max(tmp1,tmp2))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
power = 1
a = 10**9 + 7
for i in range(1,N+1,1):
    power = power*i
print(power%a)


Fixed submission:
N = int(input())
ans = 1
for i in range(1,N+1,1):
    ans = (ans*i)%(10**9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
K, S = map(int,input().split())
count = 0
for x in range(0,K+1,1):
  for y in range(0,K+1,1):
    z = S - x - y
    print(x,y,z)
    if x+y+z == S and z <= K and z >= 0:
      count += 1
print(count)

Fixed submission:
s = str(input())
s=s.replace(","," ")
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int,input().split())
count = 0
for x in range(0,K+1,1):
  for y in range(0,K+1,1):
    z = S - x - y
    if x+y+z == S and z <= K and z >= 0:
      count += 1
print(count)

Fixed submission:
K, S = map(int,input().split())
count = 0
for x in range(0,K+1,1):
  for y in range(0,K+1,1):
    if 0<=S-x-y<=K:
      count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
c = str(input()))
if (c=="a" or c=="i" or c=="u" or c=="e" or c=="o"):
  print("vowel")
else:
  print("consonant")

Fixed submission:
c = str(input())
if (c=="a" or c=="i" or c=="u" or c=="e" or c=="o"):
  print("vowel")
else:
  print("consonant")
Buggy python submission (verdict: Runtime Error):
a, b, x = map(int,input().split())
tmp = a
while True:
    if tmp % x == 0:
        break
    else:
        tmp += 1
print((b//tmp)-(a//tmp))


Fixed submission:
a, b, x = map(int,input().split())
print((b//x)-(a-1)//x)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int,input().split())
tmp = a
while True:
    if tmp % x == 0:
        break
    else:
        tmp += 1
li = [i for i in range(tmp,b+1,x)]
print(len(li))


Fixed submission:
a, b, x = map(int,input().split())
print((b//x)-(a-1)//x)
Buggy python submission (verdict: Runtime Error):
H, W  = map(int,input().split())
S = [list(map(str,input().split())) for i in range(H)]
char = "ABCDEFGHIJ"
for i in range(H):
    for j in range(W):
        if S[i][j] == "snuke":
            tmp = [i,j]
ans = str(char[tmp[1]]) + str(tmp[0]+1)
print(ans)

Fixed submission:
H, W  = map(int,input().split())
S = [list(map(str,input().split())) for i in range(H)]
char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(H):
    for j in range(W):
        if S[i][j] == "snuke":
            tmp = [i,j]
ans = str(char[tmp[1]]) + str(tmp[0]+1)
print(ans)
Buggy python submission (verdict: Runtime Error):
W,H,N = map(int,input().split())
bo = [[0]*W]*H
li = [list(map(int,input().split())) for i in range(N)]
for i in range(N):
    if li[i][2] == 1:
        for j in range(li[i][0]):
            bo[i][j] = 1
    elif li[i][2] == 2:
        for j in range(li[i][0],W,1):
            bo[i][j] = 1
    elif li[i][2] == 3:
        for j in range(li[i][1]):
            bo[j] = [1]*W
    else:
        for j in range(H-1,li[i][1]-1,-1):
            bo[j] = [1]*W

sum = 0

for i in range(H):
    sum += bo[i][:].count(1)
print((W*H)-sum)

Fixed submission:
W,H,N = map(int,input().split())
bo = [[0]*W]*H
for i in range(N):
    x,y,z = map(int,input().split())
    if z == 1:
        for j in range(H):
            for k in range(x):
                bo[j][k] = 1
    elif z == 2:
        for j in range(H):
            for k in range(x,W,1):
                bo[j][k] = 1
    elif z == 3:
        for j in range(y):
            bo[j] = [1]*W
    else:
        for j in range(H-1,y-1,-1):
            bo[j] = [1]*W

sum = 0

for i in range(H-1,-1,-1):
    sum += bo[i][:].count(1)
print((W*H)-sum)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d=map(int, input().split())
i=0
while True:
  i+=1
  if i%2!=0: 
    c-=b
    if c==0: 
      print('Yes')
      break
  if i%2==0: 
    a-=d
    if a==0:
      print('No')
      break

Fixed submission:
a,b,c,d=map(int, input().split())
import math
if math.ceil(c/b)<=math.ceil(a/d): print('Yes')
else: print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
n = range(1,int(input())+1)
pp = list(itertools.product(n, repeat=3))
sum = 0
for p in pp:
  sum+=math.gcd(math.gcd(p[0],p[1]),p[2])
print(sum)

Fixed submission:
import math
import itertools
n = range(1,int(input())+1)
ppp = list(itertools.combinations(n, 3))
pp = list(itertools.combinations(n, 2))
asum,bsum,csum = 0,0,0
for p in ppp:
  asum+=math.gcd(math.gcd(p[0],p[1]),p[2])

for p in pp:
  bsum+=math.gcd(p[0],p[1])

for p in n:
  csum+=p

print(asum*6+bsum*6+csum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import math
import itertools
n = np.arange(1,int(input())+1)
pp = list(itertools.product(n, repeat=3))
sum = 0
for p in pp:
  sum+=math.gcd(math.gcd(p[0],p[1]),p[2])
print(sum)

Fixed submission:
import math
import itertools
n = range(1,int(input())+1)
ppp = list(itertools.combinations(n, 3))
pp = list(itertools.combinations(n, 2))
asum,bsum,csum = 0,0,0
for p in ppp:
  asum+=math.gcd(math.gcd(p[0],p[1]),p[2])

for p in pp:
  bsum+=math.gcd(p[0],p[1])

for p in n:
  csum+=p

print(asum*6+bsum*6+csum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import math
import itertools
nums = np.arange(1,int(input())+1)
pp = list(itertools.product(nums, repeat=3))
sum = 0
for p in pp:
  k=math.gcd(p[0],p[1])
  sum+=math.gcd(k,p[2])
print(sum)

Fixed submission:
import math
import itertools
n = range(1,int(input())+1)
ppp = list(itertools.combinations(n, 3))
pp = list(itertools.combinations(n, 2))
asum,bsum,csum = 0,0,0
for p in ppp:
  asum+=math.gcd(math.gcd(p[0],p[1]),p[2])

for p in pp:
  bsum+=math.gcd(p[0],p[1])

for p in n:
  csum+=p

print(asum*6+bsum*6+csum)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' '))

b_l = list(range(int(b/0.1), int((b+0.99)//0.1+1)))
for b_ in b_l:
  s = int(b_*0.08//1)
  if s==a:
    print(str(b_))
    exit(0)
print(-1)

Fixed submission:
sum_ = float(input())
taiseki = float((sum_/3)**3)
print('%.7f'%taiseki)
Buggy python submission (verdict: Runtime Error):
#count
for l in lis:
  if l in dic: dic[l] += 1
  else: dic[l] = 1

#dic_sum = dic.copy()
s = 0
#calcurate
for d in dic:
  s += int(dic[d]*(dic[d]-1)/2)
  
for i in range(inp):
  #dic_sum_n = dic_sum.copy()
  t = dic[lis[i]]
  print(s-int(t*(t-1)/2)+int((t-1)*(t-2)/2))


Fixed submission:
inp = int(input())
lis = list(map(int, input().split()))

dic = {}

#count
for l in lis:
  if l in dic: dic[l] += 1
  else: dic[l] = 1

#dic_sum = dic.copy()
s = 0
#calcurate
for d in dic:
  s += int(dic[d]*(dic[d]-1)//2)
  
for i in range(inp):
  #dic_sum_n = dic_sum.copy()
  t = dic[lis[i]]
  print(s-int(t*(t-1)//2)+int((t-1)*(t-2)//2))

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

dic = {}

#count
for l in lis:
  if l in dic: dic[l] += 1
  else: dic[l] = 1

dic_sum = dic.copy()
#calcurate
for d in dic:
  dic_sum[d]=int(dic[d]*(dic[d]-1)/2)
  
for l in lis:
  dic_sum_n = dic_sum.copy()
  if l in dic:
    dic_sum_n[l] = int(((dic[l]-1)*(dic[l]-2))/2)
    print(sum(dic_sum_n.values()))

Fixed submission:
inp = int(input())
lis = list(map(int, input().split()))

dic = {}

#count
for l in lis:
  if l in dic: dic[l] += 1
  else: dic[l] = 1

#dic_sum = dic.copy()
s = 0
#calcurate
for d in dic:
  s += int(dic[d]*(dic[d]-1)//2)
  
for i in range(inp):
  #dic_sum_n = dic_sum.copy()
  t = dic[lis[i]]
  print(s-int(t*(t-1)//2)+int((t-1)*(t-2)//2))
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split(' '))
print(min(int(n%(a+b)),a)+int((n//(a+b)1)*a))

Fixed submission:
n, a, b = map(int, input().split(' '))
r = n//(a+b)
print(int(r*a+min((n-r*(a+b),a))))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' '))

b_l = list(range(int(b/0.1), int((b+0.99)//0.1+1)))
for b_ in b_l:
  s = int(b_*0.08//1)
  if s==a:
    print(str(b_))
    exit(0)
prin('-1')

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

b_l = list(range(int(b/0.1), int((b+0.99)//0.1+1)))
for b_ in b_l:
  s = int(b_*0.08//1)
  if s==a:
    print(str(b_))
    exit(0)
print('-1')
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
words = []
for i in range(n):
  words.append(input())
c = collections.Counter(words)
max_w = []
for i in c.most_common():
  if i[1]==c.most_common()[0][1]:
    max_w.append(i[0])
max_w.sort()
[print(j) for j in max_w]


Fixed submission:
import collections
n = int(input())
words = []
[words.append(input()) for i in range(n)]
c = collections.Counter(words)
cc = c.most_common()
max_w = []
for i in cc:
  if i[1]==cc[0][1]:
    max_w.append(i[0])
max_w.sort()
[print(j) for j in max_w]
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p_ls = list(map(int, input().split()))
sum_=0
for i in range(0,n):
  j=0
  if i==0: max_,min_=p_ls[i],p_ls[i]
  #print('%d %d'%(i,j))
  #print(max_)
  while j<=i:
    if min_>p_ls[i]: 
      min_=p_ls[i]
      break
    elif max_<p_ls[i]:
      max_=p_ls[i]
      sum_-=1
      break
    elif p_ls[j]<p_ls[i]:
      sum_-=1
      break
    j+=1
  sum_+=1
print(sum_)

Fixed submission:
n = int(input())
p_ls = list(map(int, input().split()))
sum_=1
min_=p_ls[0]
for i in range(1,n):
  if min_>=p_ls[i]:
    min_=p_ls[i]
    sum_+=1
print(sum_)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p_ls = list(map(int, input().split()))
sum_=1
for i in range(1,n):
  j=0
  #print('%d %d'%(i,j))
  while j<=i:
    if p_ls[j]<p_ls[i]:
      sum_-=1
      break
    j+=1
  sum_+=1
print(sum_)

Fixed submission:
n = int(input())
p_ls = list(map(int, input().split()))
sum_=1
min_=p_ls[0]
for i in range(1,n):
  if min_>=p_ls[i]:
    min_=p_ls[i]
    sum_+=1
print(sum_)
Buggy python submission (verdict: Runtime Error):
le = int(input())
ll = list(map(int, input().split()))
 
res = h[0]
for i in range(1, ll):
    if(ll[i-1] < ll[i]): res += ll[i]-ll[i-1]
print(res)

Fixed submission:
le = int(input())
ll = list(map(int, input().split()))
 
res = ll[0]
for i in range(1, le):
    if(ll[i-1] < ll[i]): res += ll[i]-ll[i-1]
print(res)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
ans = 10

for i in reversed(range(1,int(math.sqrt(N)) + 1)):
    if N % i == 0:
        A = len(str(i))
        B = len(str(N //  i))
        print (N // i)
        ans = min(ans,max(A,B))

print(ans)


Fixed submission:
A,B = (map(int, input().split()))
print (A + B if A + B < 24 else A + B - 24)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
cnt = 0
if b > 10 ** 9:
        cnt = (b-a) / c
        print (cnt)
else:
    for i in range(a,b+1):
        if i % c == 0:
            cnt += 1
    print (cnt)

Fixed submission:
a,b,x = map(int, raw_input().split())
print b / x - (a-1) / x
Buggy python submission (verdict: Time Limit Exceeded):
# 200216 C

import collections

N = int(input())
S = [""] * N
for i in range(N):
    S[i] = input()
c = collections.Counter(S)
cv = c.values()
ans = []
for i in c:
    if c[i] == max(cv):
        ans.append(i)
ans = sorted(ans)
for i in ans:
    print(i,end=" ")
print("")


Fixed submission:
# 200216 C

import collections

N = int(input())
S = [""] * N
dic = {}
for i in range(N):
    S = input()
    if S in dic:
        dic[S] += 1
    else:
        dic[S] = 1

maxs = max(list(dic.values()))
ans = []
for i in dic:
    if dic[i] == maxs:
        ans.append(i)
ans = sorted(ans)
for i in ans:
    print(i,end=" ")
print("")

Buggy python submission (verdict: Time Limit Exceeded):
# 200216 C

import collections

N = int(input())
S = [""] * N
for i in range(N):
    S[i] = input()

c = collections.Counter(S)
cv = c.values()
ans = []
for i in c:
    if c[i] == max(cv):
        ans.append(i)
ans = sorted(ans)
for i in ans:
    print(i,end=" ")
print("")


Fixed submission:
# 200216 C

import collections

N = int(input())
S = [""] * N
dic = {}
for i in range(N):
    S = input()
    if S in dic:
        dic[S] += 1
    else:
        dic[S] = 1

maxs = max(list(dic.values()))
ans = []
for i in dic:
    if dic[i] == maxs:
        ans.append(i)
ans = sorted(ans)
for i in ans:
    print(i,end=" ")
print("")

Buggy python submission (verdict: Time Limit Exceeded):
# 200216 C

N = int(input())
S = [""] * N
for i in range(N):
    S[i] = input()


Ssimple = sorted(list(set(S)))
cntlist = [0] * len(Ssimple)

for i in range(len(Ssimple)):
    cntlist[i] = S.count(Ssimple[i])

for i in range(len(Ssimple)):
    if cntlist[i] == max(cntlist):
        print(Ssimple[i],end=" ")
print("")



Fixed submission:
# 200216 C

import collections

N = int(input())
S = [""] * N
dic = {}
for i in range(N):
    S = input()
    if S in dic:
        dic[S] += 1
    else:
        dic[S] = 1

maxs = max(list(dic.values()))
ans = []
for i in dic:
    if dic[i] == maxs:
        ans.append(i)
ans = sorted(ans)
for i in ans:
    print(i,end=" ")
print("")
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int, input().split())

center = abs(a-b) // 2
# restore
if abs(a-b) % 2 == 0:
    print(center)
else:
    leftside = a - 1
    rightside = n - b
    
    print(min(leftside,rightside) + 1 + (B-A-1)//2)



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

center = abs(a-b) // 2
# restore
if abs(a-b) % 2 == 0:
    print(center)
else:
    leftside = a - 1
    rightside = n - b
    
    print(min(leftside,rightside) + 1 + (b-a-1)//2)