problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k | fixed_code stringlengths 12 526k | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M | fixed_submission_id int64 2 1.54M | user_id stringlengths 10 10 | language stringclasses 8
values |
|---|---|---|---|---|---|---|---|
p02615 | n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
print( sum( a[(i+1)//2] for i in range(n)) ) | n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
print( sum( a[i//2] for i in range(1,n)) ) | [
"call.arguments.change",
"call.arguments.add"
] | 324,223 | 324,224 | u586759271 | python |
p02615 | n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
print( sum( a[(i+1)//2] for i in range(n)) ) | n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
print( sum( a[(i+1)//2] for i in range(n-1)) ) | [
"control_flow.loop.range.bounds.upper.change",
"expression.operation.binary.add"
] | 324,223 | 324,225 | u586759271 | python |
p02615 | import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L... | import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L... | [
"call.arguments.add"
] | 324,237 | 324,238 | u750651325 | python |
p02615 | import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L... | import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L... | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.lower.change"
] | 324,239 | 324,238 | u750651325 | python |
p02615 | N = int(input())
A = [int(hoge) for hoge in input().split()]
A.sort(reverse=True)
Twoused = (N - 1)//2
Twosum = 2*sum([A[i] for i in range(1,Twoused+1)])
if N%2:
ans = Twosum + A[0] + A[Twoused+1]
else:
ans = Twosum + A[0]
print(ans)
| N = int(input())
A = [int(hoge) for hoge in input().split()]
A.sort(reverse=True)
Twoused = (N - 2)//2
Twosum = 2*sum([A[i] for i in range(1,Twoused+1)])
if N%2:
ans = Twosum + A[0] + A[Twoused+1]
else:
ans = Twosum + A[0]
print(ans)
| [
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 324,246 | 324,247 | u268516119 | python |
p02615 | n = int(input())
sum(sorted([int(x) for x in input().split()] * 2, reverse = True)[1:n]) | n = int(input())
print(sum(sorted([int(x) for x in input().split()] * 2, reverse = True)[1:n])) | [
"call.add",
"call.arguments.change"
] | 324,250 | 324,251 | u150172296 | python |
p02615 | N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
print(A)
limit = 0
ans = 0
count = 0
lim = 0
t = N - 1
for i in range(N):
lim = 2
if i == 0:
lim = 1
for j in range(lim):
# print(j)
if t > 0:
ans += A[i]
t -= 1
... | N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
limit = 0
ans = 0
count = 0
lim = 0
t = N - 1
for i in range(N):
lim = 2
if i == 0:
lim = 1
for j in range(lim):
if t > 0:
ans += A[i]
t -= 1
print(ans)
| [
"call.remove"
] | 324,284 | 324,285 | u039860745 | python |
p02615 | from collections import deque
N = int(input())
A = list(map(int, input().split()))
A.sort(reversre=True)
ans = 0
d = deque(A[0])
for x in A[1:]:
ans += d.popleft()
d.append(x)
d.append(x)
print(ans) | from collections import deque
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
d = deque([A[0]])
for x in A[1:]:
ans += d.popleft()
d.append(x)
d.append(x)
print(ans)
| [
"identifier.change",
"call.arguments.change",
"call.arguments.keyword_argument.change"
] | 324,318 | 324,319 | u536034761 | python |
p02615 | N = int(input())
a = [int(i) for i in input().split()]
a.sort(reverse = True)
if N == 3:
print(a[0] + a[1])
ans1 = 2*sum(a[0:N//2]) - a[0]
if N%2 == 0:
print(ans1)
if N%2 == 1 and N != 3:
print(ans1 + a[(N+1)//2]) | N = int(input())
a = [int(i) for i in input().split()]
a.sort(reverse = True)
if N == 3:
print(a[0] + a[1])
ans1 = 2*sum(a[0:N//2]) - a[0]
if N%2 == 0:
print(ans1)
if N%2 == 1 and N != 3:
print(ans1 + a[N//2]) | [
"call.arguments.change"
] | 324,330 | 324,331 | u433697974 | python |
p02615 | n = int(input())
a = map(int,input().split())
a = sorted(a)
result = 0
spots = [a.pop()]
for i in range(n):
next = a.pop()
result += spots[i]
spots.append(next)
spots.append(next)
print(result) | n = int(input())
a = map(int,input().split())
a = sorted(a)
result = 0
spots = [a.pop()]
for i in range(n-1):
x = a.pop()
result += spots[i]
spots.append(x)
spots.append(x)
print(result) | [
"assignment.variable.change",
"identifier.change",
"call.arguments.change"
] | 324,334 | 324,335 | u857605629 | python |
p02615 |
def resolver(N, A):
A.sort(reverse=True)
ans = 0
for i, _ in enumerate(A):
if i == 0:
continue
elif i == 1:
ans += A[0]
else:
j = (i // 2) +1
ans += A[j]
return ans
def _resolver(N, A):
A.sort(reverse=True)
circle =... |
def resolver(N, A):
A.sort(reverse=True)
ans = 0
for i, _ in enumerate(A):
if i == 0:
continue
elif i == 1:
ans += A[0]
else:
j = (i // 2)
ans += A[j]
return ans
def _resolver(N, A):
A.sort(reverse=True)
circle = [... | [
"expression.operation.binary.remove"
] | 324,354 | 324,355 | u476674874 | python |
p02615 | n = int(input())
a = list(map(int,input().split()));
a.sort(reverse=True)
com = 0;
for k in range(n-1):
kk = n - (k+1) // 2 - 1
com += a[kk]
print(com); | n = int(input())
a = list(map(int,input().split()));
a.sort()
com = 0;
for k in range(n-1):
kk = n - (k+1) // 2 - 1
com += a[kk]
print(com); | [] | 324,358 | 324,359 | u158380546 | python |
p02615 | import heapq
n = int(input())
a = list(map(int, input().split))
a.sort(reverse=True)
ans = 0
heap = []
heapq.heappush(heap, -a[0])
for i in range(1, n):
tmp = heapq.heappop(heap)
tmp *= -1
ans += tmp
heapq.heappush(heap, -a[i])
heapq.heappush(heap, -a[i])
print(ans) | import heapq
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
heap = []
heapq.heappush(heap, -a[0])
for i in range(1, n):
tmp = heapq.heappop(heap)
tmp *= -1
ans += tmp
heapq.heappush(heap, -a[i])
heapq.heappush(heap, -a[i])
print(ans) | [
"call.add"
] | 324,362 | 324,363 | u038408819 | python |
p02615 | N = int(input())
alist = list(map(int, input().split()))
alist.sort(reverse=True)
sumscore=alist[0]
for n in range(1,int(N/2)):
sumscore = sumscore + alist[n]*2
if N%2==1:
sumscore += alist[n]
print(sumscore) | N = int(input())
alist = list(map(int, input().split()))
alist.sort(reverse=True)
sumscore=alist[0]
for n in range(1,int(N/2)):
sumscore = sumscore + alist[n]*2
if N%2==1:
sumscore += alist[n+1]
print(sumscore) | [
"expression.operation.binary.add"
] | 324,370 | 324,371 | u463921228 | python |
p02615 | # -*- coding: utf-8 -*-
n=int(input())
alist=list(map(int,input().split()))
blist=sorted(alist,reverse=True)
total=0
total+=blist[0]
for i in range(1,int(n/2)):
total+=blist[i]*2
if n%2:
total+=blist[int(n/2)+1]
print(total) | # -*- coding: utf-8 -*-
n=int(input())
alist=list(map(int,input().split()))
blist=sorted(alist,reverse=True)
total=blist[0]
for i in range(1,int(n/2)):
total+=blist[i]*2
if n%2:
total+=blist[int(n/2)]
print(total) | [
"expression.operation.binary.remove"
] | 324,375 | 324,376 | u900968659 | python |
p02615 | N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
ans += A[0]
for i in range(1, N - 1):
ans += A[tmp]
if i % 2 == 0:
tmp += 1
print(ans) | N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
ans += A[0]
tmp = 1
for i in range(1, N - 1):
ans += A[tmp]
if i % 2 == 0:
tmp += 1
print(ans) | [
"assignment.add"
] | 324,377 | 324,378 | u059210959 | python |
p02615 | N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = A[0]
if N%2 == 0:
for i in range(1,int((N/2))):
ans += A[i]*2
else:
for i in range(1,int(N/2)):
ans += A[i]*2
ans += A[N-1]
print(ans)
| N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = A[0]
if N%2 == 0:
for i in range(1,int((N/2))):
ans += A[i]*2
else:
for i in range(1,int(N/2)):
ans += A[i]*2
ans += A[int(N/2)]
print(ans)
| [
"call.add",
"call.arguments.change"
] | 324,403 | 324,404 | u455354923 | python |
p02615 | def main():
n = int(input())
friendliness = [int(x) for x in input().split()]
friendliness.sort(reversed=True)
ans = 0
for i in range(n):
ans += friendliness[i // 2 + 1]
print(ans)
if __name__ == '__main__':
main()
| def main():
n = int(input())
friendliness = [int(x) for x in input().split()]
friendliness.sort(reverse=True)
ans = 0
for i in range(1, n):
ans += friendliness[i // 2]
print(ans)
if __name__ == '__main__':
main()
| [
"identifier.change",
"call.arguments.change",
"call.arguments.keyword_argument.near.change",
"call.arguments.add",
"expression.operation.binary.remove"
] | 324,412 | 324,413 | u512212329 | python |
p02615 | N,*As=map(int,open(0).read().split());As.sort();print(As[-1]+sum(As[-2-i//2]for i in range(N-1))) | N,*As=map(int,open(0).read().split());As.sort();print(As[-1]+sum(As[-2-i//2]for i in range(N-2))) | [
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change",
"control_flow.loop.range.bounds.upper.change"
] | 324,418 | 324,419 | u450983668 | python |
p02615 | N,*As = map(int, open(0).read().split());As.sort();print(As[0]+sum(As[1+i//2]for i in range(N-1))) | N,*As=map(int,open(0).read().split());As.sort();print(As[-1]+sum(As[-2-i//2]for i in range(N-2))) | [
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change",
"expression.operation.unary.add",
"literal.number.integer.change",
"control_flow.loop.range.bounds.upper.change"
] | 324,420 | 324,419 | u450983668 | python |
p02615 | N = int(input())
A = list(map(int, input().split()))
A.sort()
A.reverse()
ans = 0
ans += A[0]
if len(A) % 2 == 0:
tmp = 0
for i in range(1, int((N-2)/2)+1):
tmp += A[i] * 2
else:
tmp = 0
for i in range(1, int((N-1)/2)+1):
tmp += A[i] * 2
tmp -= A[int((N-3)/2)]
ans += tmp
print(ans)
| N = int(input())
A = list(map(int, input().split()))
A.sort()
A.reverse()
ans = 0
ans += A[0]
if len(A) % 2 == 0:
tmp = 0
for i in range(1, int((N-2)/2)+1):
tmp += A[i] * 2
else:
tmp = 0
for i in range(1, int((N-1)/2)+1):
tmp += A[i] * 2
tmp -= A[int((N-1)/2)]
ans += tmp
print(ans)
| [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 324,421 | 324,422 | u886297662 | python |
p02615 | N = int(input())
A = list(map(int, input().split()))
A.sort()
A.reverse()
ans = 0
ans += A[0]
if len(A) % 2 == 0:
tmp = 0
for i in range(1, int((N-2)/2)+1):
tmp += A[i] * 2
else:
for i in range(1, int((N-1)/2)+1):
tmp += A[i] * 2
tmp -= A[int((N-3)/2)]
ans += tmp
print(ans)
| N = int(input())
A = list(map(int, input().split()))
A.sort()
A.reverse()
ans = 0
ans += A[0]
if len(A) % 2 == 0:
tmp = 0
for i in range(1, int((N-2)/2)+1):
tmp += A[i] * 2
else:
tmp = 0
for i in range(1, int((N-1)/2)+1):
tmp += A[i] * 2
tmp -= A[int((N-1)/2)]
ans += tmp
print(ans)
| [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 324,423 | 324,422 | u886297662 | python |
p02615 | import sys
import numpy as np
readline = sys.stdin.readline
N = int(input())
A = np.array(readline().split(), np.int64)
A_sort = np.sort(A)[::-1] # 降順ソート
count = 0
limit = 1
t = 1
for i in range(N - 1):
if i == 0:
count += A_sort[0]
else:
count += A_sort[limit]
t += 1
if t % ... | import sys
import numpy as np
readline = sys.stdin.readline
N = int(input())
A = np.array(readline().split(), np.int64)
A_sort = np.sort(A)[::-1] # 降順ソート
count = 0
limit = 1
t = 0
for i in range(N - 1):
if i == 0:
count += A_sort[0]
else:
count += A_sort[limit]
t += 1
if t % ... | [
"literal.number.integer.change",
"assignment.value.change"
] | 324,424 | 324,425 | u570039786 | python |
p02615 | import sys
import numpy as np
readline = sys.stdin.readline
N = int(input())
A = np.array(readline().split(), np.int64)
A_sort = np.sort(A)[1:][::-1] # 降順ソート
count = 0
limit = 1
t = 1
for i in range(N - 1):
if i == 0:
count += A_sort[0]
else:
count += A_sort[limit]
t += 1
if ... | import sys
import numpy as np
readline = sys.stdin.readline
N = int(input())
A = np.array(readline().split(), np.int64)
A_sort = np.sort(A)[::-1] # 降順ソート
count = 0
limit = 1
t = 0
for i in range(N - 1):
if i == 0:
count += A_sort[0]
else:
count += A_sort[limit]
t += 1
if t % ... | [
"literal.number.integer.change",
"assignment.value.change"
] | 324,426 | 324,425 | u570039786 | python |
p02615 | N = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
#print(A)
if N%2 == 0:
print(sum(A[:N//2]) * 2 - A[0])
if N%2 == 1:
print(sum(A[:N//2+1]) * 2 - A[0] - A[N//2+1]) | N = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
#print(A)
if N%2 == 0:
print(sum(A[:N//2]) * 2 - A[0])
if N%2 == 1:
#print(A[:N//2+1],A[N//2+1])
print(sum(A[:N//2+1]) * 2 - A[0] - A[N//2])
| [
"expression.operation.binary.remove"
] | 324,479 | 324,480 | u489124637 | python |
p02615 | N=int(input())
a=list(map(int,input().split()))
a.sort()
ans=a[-1]
for i in range(N-2):
ans+=a[-i//2-2]
print(ans) | N=int(input())
a=list(map(int,input().split()))
a.sort()
ans=a[-1]
for i in range(N-2):
ans+=a[-(i//2)-2]
print(ans) | [] | 324,490 | 324,491 | u970809473 | python |
p02615 | n = int(input())
li_a = list(map(int,input().split()))
li_a.sort(reverse=True)
ans = li_a[0]
if n % 2 == 0:
for i in range(1,n//2):
ans += 2*li_a[i]
else:
for i in range(1,n//2):
ans += 2*li_a[i]
ans += li_a[n//2+1]
print(ans) | n = int(input())
li_a = list(map(int,input().split()))
li_a.sort(reverse=True)
ans = li_a[0]
if n % 2 == 0:
for i in range(1,n//2):
ans += 2*li_a[i]
else:
for i in range(1,n//2):
ans += 2*li_a[i]
ans += li_a[n//2]
print(ans) | [
"expression.operation.binary.remove"
] | 324,492 | 324,493 | u363074342 | python |
p02615 | n = int(input())
li_a = list(map(int, input().split()))
sum_ = 0
li_a.sort()
for i in range(n-1):
sum_ += li_a[n-1-(i)//2]
print(sum_) | n = int(input())
li_a = list(map(int, input().split()))
sum_ = 0
li_a.sort()
for i in range(1, n):
sum_ += li_a[n-1-i//2]
print(sum_)
| [
"expression.operation.binary.remove",
"call.arguments.add"
] | 324,494 | 324,495 | u594803920 | python |
p02615 | N=int(input())
A=list(map(int, input().split()))
A.sort()
if N==2:
print(A[-1])
exit()
ans=0
for i in range(N-1):
ans+=A[(i-2)//2]
print(ans) | N=int(input())
A=list(map(int, input().split()))
A.sort()
if N==2:
print(A[-1])
exit()
ans=0
for i in range(N-1):
ans+=A[(-i-2)//2]
print(ans) | [
"expression.operation.unary.add"
] | 324,506 | 324,507 | u095021077 | python |
p02615 | n = int(input())
a_list = list(map(int, input().split()))
a_list.sort(reverse=True)
ans = 0
for i in range(0, n - 1):
ans += A[(i + 1) // 2]
print(ans) | n = int(input())
a_list = list(map(int, input().split()))
a_list.sort(reverse=True)
ans = 0
for i in range(0, n - 1):
ans += a_list[(i + 1) // 2]
print(ans) | [
"identifier.change"
] | 324,528 | 324,529 | u264312747 | python |
p02615 | import copy
from collections import deque
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
d = deque()
c = 0
count = 2
ans = 0
if N == 2:
print(A[0])
elif N == 3:
print(A[0] + A[1])
else:
ans = A[0] + A[1]
for i in range(3, N-1):
if c == 0:
ans += A[count... | # coding: utf-8
# Your code here!
import copy
from collections import deque
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
d = deque()
c = 0
count = 2
ans = 0
if N == 2:
print(A[0])
elif N == 3:
print(A[0] + A[1])
else:
ans = A[0] + A[1]
for i in range(3, N-1):
if... | [] | 324,534 | 324,535 | u447679353 | python |
p02615 | import copy
from collections import deque
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
d = deque()
c = 0
count = 2
ans = 0
if N == 2:
print(A[0])
elif N == 3:
print(A[0] + A[1])
else:
ans = A[0] + A[1]
for i in range(3, N-1):
if c == 0:
ans += A[count... | # coding: utf-8
# Your code here!
import copy
from collections import deque
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
d = deque()
c = 0
count = 2
ans = 0
if N == 2:
print(A[0])
elif N == 3:
print(A[0] + A[1])
else:
ans = A[0] + A[1]
for i in range(3, N-1):
if... | [] | 324,536 | 324,535 | u447679353 | python |
p02615 | #ord(s)
import copy
from collections import deque
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
d = deque()
c = 0
count = 2
ans = 0
if N == 2:
print(A[0])
elif N == 3:
print(A[0] + A[1])
else:
ans = A[0] + A[1]
for i in range(3, N-1):
if c == 0:
ans +=... | # coding: utf-8
# Your code here!
import copy
from collections import deque
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
d = deque()
c = 0
count = 2
ans = 0
if N == 2:
print(A[0])
elif N == 3:
print(A[0] + A[1])
else:
ans = A[0] + A[1]
for i in range(3, N-1):
if... | [] | 324,537 | 324,535 | u447679353 | python |
p02615 | n=int(input())
arr=list(map(int,input().split()))
arr=sorted(ans,reverse=True)
ans=0
for i in range(1,n):
ans+=arr[i//2]
print(ans) | n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr,reverse=True)
ans=0
for i in range(1,n):
ans+=arr[i//2]
print(ans) | [
"assignment.value.change",
"identifier.change",
"call.arguments.change"
] | 324,554 | 324,555 | u163320134 | python |
p02615 | import math
N = int(input())
Nlist = list(map(int, input().split()))
Nlist.sort(reverse=True)
x = math.ceil(N/2)
ans = sum(Nlist[0:x])*2-Nlist[0]
print(ans)
if N % 2 != 0:
ans -= Nlist[x-1]
print(ans)
| import math
N = int(input())
Nlist = list(map(int, input().split()))
Nlist.sort(reverse=True)
x = math.ceil(N/2)
ans = sum(Nlist[0:x])*2-Nlist[0]
if N % 2 != 0:
ans -= Nlist[x-1]
print(ans)
| [
"call.remove"
] | 324,556 | 324,557 | u815763296 | python |
p02615 | import math
N = int(input())
Nlist = list(map(int, input().split()))
Nlist.sort(reverse=True)
x = math.ceil(N/2)
ans = sum(Nlist[0:x])*2-Nlist[0]
if N % 2 != 0:
ans -= Nlist[x]
print(ans)
| import math
N = int(input())
Nlist = list(map(int, input().split()))
Nlist.sort(reverse=True)
x = math.ceil(N/2)
ans = sum(Nlist[0:x])*2-Nlist[0]
if N % 2 != 0:
ans -= Nlist[x-1]
print(ans)
| [
"expression.operation.binary.add"
] | 324,558 | 324,557 | u815763296 | python |
p02615 | N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
if N == 2:
ans = A[0]
elif N == 3:
ans = sum(A[:2])
elif N == 4:
ans = sum(A[:2])+A[1]
elif N == 5:
ans = sum(A[:2])+A[1]+A[2]
elif N == 6:
ans = sum(A[:2])+A[1]+A[2]*2
else:
ans = sum(A[:2])+A[1]+A[2]*2
# print(ans)... | N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
if N == 2:
ans = A[0]
elif N == 3:
ans = sum(A[:2])
elif N == 4:
ans = sum(A[:2])+A[1]
elif N == 5:
ans = sum(A[:2])+A[1]+A[2]
elif N == 6:
ans = sum(A[:2])+A[1]+A[2]*2
else:
ans = sum(A[:2])+A[1]+A[2]*2
# print(ans)... | [
"expression.operation.binary.remove"
] | 324,569 | 324,570 | u830054172 | python |
p02615 | N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
if N == 2:
ans = A[0]
elif N == 3:
ans = sum(A[:2])
elif N == 4:
ans = sum(A[:2])+A[1]
elif N == 5:
ans = sum(A[:2])+A[1]+A[2]
elif N == 6:
ans = sum(A[:2])+A[1]+A[2]*2
else:
ans = sum(A[:2])+A[1]+A[2]*2
print(ans)
... | N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
if N == 2:
ans = A[0]
elif N == 3:
ans = sum(A[:2])
elif N == 4:
ans = sum(A[:2])+A[1]
elif N == 5:
ans = sum(A[:2])+A[1]+A[2]
elif N == 6:
ans = sum(A[:2])+A[1]+A[2]*2
else:
ans = sum(A[:2])+A[1]+A[2]*2
# print(ans)... | [
"call.remove",
"expression.operation.binary.remove"
] | 324,571 | 324,570 | u830054172 | python |
p02615 | N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans=0
for i in range(N-1):
ans += A[i+1//2]
print(ans) | N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans=0
for i in range(N-1):
ans += A[(i+1)//2]
print(ans) | [] | 324,600 | 324,601 | u981760053 | python |
p02615 | import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1
n = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
for i in range(1,n):
ans += A[i-1]
print(ans) | import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1
n = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
for i in range(1,n):
ans += A[i//2]
print(ans) | [] | 324,606 | 324,607 | u716530146 | python |
p02615 | n = int(input())
l = list(map(int,input().split()))
l_sort = sorted(l,reverse=True)
l_len = len(l)
if(l_len%2==0):
ans = sum(l_sort[:(l_len//2)-1])+sum(l_sort[1:(l_len//2)])+l_sort[(l_len//2)]
else:
ans = sum(l_sort[:(l_len//2)])+sum(l_sort[1:(l_len//2)+1])
print(ans)
| n = int(input())
l = list(map(int,input().split()))
l_sort = sorted(l,reverse=True)
l_len = len(l)
if(l_len%2==0):
ans = sum(l_sort[:(l_len//2)-1])+sum(l_sort[1:(l_len//2)])+l_sort[(l_len//2)-1]
else:
ans = sum(l_sort[:(l_len//2)])+sum(l_sort[1:(l_len//2)+1])
print(ans)
| [
"assignment.change"
] | 324,620 | 324,621 | u092387689 | python |
p02615 | n=int(input())
l=list(map(int,input().split()))
l.sort()
sum=l[-1]
for i in range(1,n//2):
sum+=2*l[-1-i]
if n%2!=0:
sum+=l[n//2-1]
print(sum) | n=int(input())
l=list(map(int,input().split()))
l.sort()
sum=l[-1]
for i in range(1,n//2):
sum+=2*l[-1-i]
if n%2!=0:
sum+=l[n//2]
print(sum) | [
"expression.operation.binary.remove"
] | 324,622 | 324,623 | u275392848 | python |
p02615 | n=int(input())
a=sorted(list(map(int,input().split())),reverse=True)
if n%2==0:
print(sum(a[:n//2])*2-a[0])
else:
print(sum(a[:n//2])*2+a[n//2+1]-a[0]) | n=int(input())
a=sorted(list(map(int,input().split())),reverse=True)
if n%2==0:
print(sum(a[:n//2])*2-a[0])
else:
print(sum(a[:n//2])*2+a[n//2]-a[0]) | [
"expression.operation.binary.remove"
] | 324,650 | 324,651 | u492910842 | python |
p02615 | def readinput():
n=int(input())
a=list(map(int,input().split()))
return n,a
def main(n,a):
#print(a)
a.sort(reverse=True)
#print(a)
sum=a[0]
j=1
k=1
for i in range(2,n):
sum+=a[k]
j+=1
if j==2:
j=0
k+=1
return sum
if __name__=... | def readinput():
n=int(input())
a=list(map(int,input().split()))
return n,a
def main(n,a):
#print(a)
a.sort(reverse=True)
#print(a)
sum=a[0]
j=0
k=1
for i in range(2,n):
sum+=a[k]
#print(a[k])
j+=1
if j==2:
j=0
k+=1
ret... | [
"literal.number.integer.change",
"assignment.value.change"
] | 324,664 | 324,665 | u592547545 | python |
p02615 | import sys
import numpy as np
readline = sys.stdin.readline
read = sys.stdin.read
n = int(input())
a = np.array(readline().split(), dtype=np.int64)
a.sort()
a = a[::-1]
print(a)
m = -(-n//2)
ans = np.sum(a[:m])*2 - a[0] if n % 2 == 0 else np.sum(a[:m])*2 - a[0] - a[m-1]
print(ans)
| import sys
import numpy as np
readline = sys.stdin.readline
read = sys.stdin.read
n = int(input())
a = np.array(readline().split(), dtype=np.int64)
a.sort()
a = a[::-1]
m = -(-n//2)
ans = np.sum(a[:m])*2 - a[0] if n % 2 == 0 else np.sum(a[:m])*2 - a[0] - a[m-1]
print(ans) | [
"call.remove"
] | 324,685 | 324,686 | u852790844 | python |
p02615 | import sys
import numpy as np
readline = sys.stdin.readline
read = sys.stdin.read
n = int(input())
a = np.array(readline().split(), dtype=np.int64)
a.sort()
a = a[::-1]
m = -(-n//2)
ans = np.sum(a[:m])*2 - a[0] if n % 2 == 0 else np.sum(a[:m])*2 - a[0] - a[m]
print(ans) | import sys
import numpy as np
readline = sys.stdin.readline
read = sys.stdin.read
n = int(input())
a = np.array(readline().split(), dtype=np.int64)
a.sort()
a = a[::-1]
m = -(-n//2)
ans = np.sum(a[:m])*2 - a[0] if n % 2 == 0 else np.sum(a[:m])*2 - a[0] - a[m-1]
print(ans) | [
"assignment.change"
] | 324,687 | 324,686 | u852790844 | python |
p02615 | s=0
N=int(input())
L=list(map(int,input().split()))
L=sorted(L,reverse=True)
if N%2==0:
s+=L[0]
s+=2*sum(L[1:N//2])
else:
s+=L[0]
s+=2*sum(L[1:(N+1)//2])-L[(N+1)//2]
print(s) | s=0
N=int(input())
L=list(map(int,input().split()))
L=sorted(L,reverse=True)
if N%2==0:
s+=L[0]
s+=2*sum(L[1:N//2])
else:
s+=L[0]
s+=2*sum(L[1:(N+1)//2])-L[((N+1)//2)-1]
print(s) | [
"expression.operation.binary.add"
] | 324,698 | 324,699 | u969708690 | python |
p02615 | import sys
def resolve():
inp = sys.stdin.readlines()
inp = list(map(lambda x: x.strip(), inp))
N = int(inp[0])
A = list(map(int, inp[1].split(' ')))
A.sort(reverse=True)
num = 0
for i in range(N-1):
num += A[i+1//2]
print(num)
resolve() | import sys
def resolve():
inp = sys.stdin.readlines()
inp = list(map(lambda x: x.strip(), inp))
N = int(inp[0])
A = list(map(int, inp[1].split(' ')))
A.sort(reverse=True)
num = 0
for i in range(N-1):
num += A[(i+1)//2]
print(num)
resolve() | [] | 324,717 | 324,718 | u801533740 | python |
p02615 | n = int(input())
a = list(map(int,input().split()))
a.sort(reverse = True)
ans = 0
ans += a[0]
i = 1
j = 1
while i < n-1 :
if i+2 < n-1 :
ans += 2*a[j]
j += 1
i += 2
else :
ans += a[j]
j += 1
i += 1
print(ans)
| n = int(input())
a = list(map(int,input().split()))
a.sort(reverse = True)
ans = 0
ans += a[0]
i = 1
j = 1
while i < n-1 :
if i+2 <= n-1 :
ans += 2*a[j]
j += 1
i += 2
else :
ans += a[j]
j += 1
i += 1
print(ans)
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 324,725 | 324,726 | u649326276 | python |
p02615 | num = (int)(input())
a = sorted(list(map(int, input().split(" "))), reverse=True)
b = [a[0]]
total = a[0]
for i in range(3, num):
total += a[(i - 1) // 2]
print(total) | num = (int)(input())
a = sorted(list(map(int, input().split(" "))), reverse=True)
b = [a[0]]
total = a[0]
for i in range(3, num + 1):
total += a[(i - 1) // 2]
print(total) | [
"control_flow.loop.range.bounds.upper.change",
"expression.operation.binary.add"
] | 324,741 | 324,742 | u112007848 | python |
p02615 | n = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = A[0]
for i in range(1,n-1):
ans += A[(i//2) + 1]
print(ans) | n = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = A[0]
for i in range(n-2):
ans += A[(i//2) + 1]
print(ans) | [
"call.arguments.change",
"literal.number.integer.change",
"expression.operation.binary.change",
"control_flow.loop.range.bounds.upper.change"
] | 324,743 | 324,744 | u638033979 | python |
p02615 |
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans=A[0]
if N%2==0:
mat=N//2
for i in range(mat-1):
ans+=2*A[1+i]
else:
mat=(N-1)//2
for j in range(mat-1):
ans+=2*A[1+j]
ans+=A[mat-1]
print(ans) |
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans=A[0]
if N%2==0:
mat=N//2
for i in range(mat-1):
ans+=2*A[1+i]
else:
mat=(N-1)//2
for j in range(mat-1):
ans+=2*A[1+j]
ans+=A[mat]
print(ans) | [
"expression.operation.binary.remove"
] | 324,752 | 324,753 | u111652094 | python |
p02615 | # -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache
#############
# Const... | # -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache
#############
# Const... | [
"expression.operation.unary.add",
"expression.operator.change",
"call.arguments.change"
] | 324,762 | 324,763 | u493130708 | python |
p02615 | n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()
if n%2==0:
s=0
s=2*(sum(a[0:(n//2)]))-a[0]
print(s)
else:
s=0
s=2*(sum(a[0:(n//2)+1]))-a[0]-a[(n+1)//2]
print(s) | n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()
if n%2==0:
s=0
s=2*(sum(a[0:(n//2)]))-a[0]
print(s)
else:
s=0
s=2*(sum(a[0:(n//2)+1]))-a[0]-a[n//2]
print(s) | [] | 324,768 | 324,769 | u271210469 | python |
p02615 | import collections
N = int(input())
As = list(map(int, input().split()))
As.sort(reverse = True)
print(As)
circle_que = collections.deque()
circle_que.append(As[0])
ans = 0
for A in As[1:]:
circle_que.append(A)
circle_que.append(A)
ans += circle_que.popleft()
#print(ans)
print(ans) | import collections
N = int(input())
As = list(map(int, input().split()))
As.sort(reverse = True)
#print(As)
circle_que = collections.deque()
circle_que.append(As[0])
ans = 0
for A in As[1:]:
circle_que.append(A)
circle_que.append(A)
ans += circle_que.popleft()
#print(ans)
print(ans) | [
"call.remove"
] | 324,795 | 324,796 | u655663334 | python |
p02615 | n=int(input())
a=list(map(int,input().split()))
sorted=sorted(a,reverse=True)
#print(len(sorted[2:])//2)
ans=sorted[0]
for i in range(1,len(sorted[2:])//2 + 1):
ans+=sorted[1+i]*2
#print(sorted[1+i])
if len(a)%2==1:
ans+=sorted[2 + len(sorted[2:])//2]
print(ans) | n=int(input())
a=list(map(int,input().split()))
sorted=sorted(a,reverse=True)
#print(len(sorted[2:])//2)
ans=sorted[0]
for i in range(len(sorted[2:])//2):
ans+=sorted[1+i]*2
#print(ans)
if len(a)%2==1:
ans+=sorted[1 + len(sorted[2:])//2]
#print(111)
print(ans) | [
"call.arguments.change",
"expression.operation.binary.remove",
"literal.number.integer.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 324,823 | 324,824 | u087731474 | python |
p02615 | #!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return... | #!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return... | [
"call.arguments.add"
] | 324,831 | 324,832 | u423585790 | python |
p02615 | import math
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = a[0]
for i in range(2, n):
ans += a[math.ceil(i / 2)]
print(ans)
| import math
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = a[0]
for i in range(1, n - 1):
ans += a[math.ceil(i / 2)]
print(ans)
| [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.lower.change"
] | 324,845 | 324,846 | u811436126 | python |
p02615 | n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(1, n):
ans += a[n-int(i/2)]
print(ans)
| n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(1, n):
ans += a[n-int(i/2)-1]
print(ans)
| [
"expression.operation.binary.add"
] | 324,858 | 324,859 | u763534217 | python |
p02615 | import collections
def resolve():
N = int(input())
A = [int(x) for x in input().split(" ")]
setA = set(A)
listA = list(setA)
collectionA = collections.Counter(A)
result = listA[-1]
collectionA[listA[-1]] -= 1
if collectionA[listA[-1]] == 0:
listA.pop()
for list_a in listA:
collectionA[list... | import collections
def resolve():
N = int(input())
A = [int(x) for x in input().split(" ")]
setA = set(A)
listA = sorted(list(setA))
collectionA = collections.Counter(A)
result = listA[-1]
collectionA[listA[-1]] -= 1
if collectionA[listA[-1]] == 0:
listA.pop()
for list_a in listA:
collecti... | [
"call.add",
"call.arguments.change"
] | 324,874 | 324,875 | u805332733 | python |
p02615 | import heapq
n = int(input())
a_lst = list(map(int, input().split(" ")))
a_lst.sort(reverse=True)
result = 0
heap = []
heapq.heappush(heap,a_lst[0])
for i in a_lst[1:]:
now_max = heapq.heappop(heap)
result += now_max
heapq.heappush(heap, i)
heapq.heappush(heap, i)
print(result) | import heapq
n = int(input())
a_lst = list(map(int, input().split(" ")))
a_lst.sort(reverse=True)
result = 0
heap = []
heapq.heappush(heap,-a_lst[0])
for i in a_lst[1:]:
now_max = heapq.heappop(heap)
result += now_max
heapq.heappush(heap, -i)
heapq.heappush(heap, -i)
print(-result) | [
"expression.operation.unary.add",
"call.arguments.change"
] | 324,892 | 324,893 | u162509778 | python |
p02615 | N = int(input())
A = list(map(int, input().split()))
A.sort()
A.reverse()
list = []
ans = 0
list.append(A[0])
for i in range(len(A)):
ans += list[i]
list.append(A[i])
list.append(A[i])
print(ans) | N = int(input())
A = list(map(int, input().split()))
A.sort()
A.reverse()
list = []
ans = 0
list.append(A[0])
for i in range(1, len(A)):
ans += list[i - 1]
list.append(A[i])
list.append(A[i])
print(ans) | [
"call.arguments.add"
] | 324,915 | 324,916 | u661764795 | python |
p02615 | N = int(input())
A = list(map(int, input().split()))
A.sort()
A.reverse()
list = []
ans = 0
list.append(A[0])
for i in range(1, len(A)):
ans += list[i]
list.append(A[i])
list.append(A[i])
print(ans) | N = int(input())
A = list(map(int, input().split()))
A.sort()
A.reverse()
list = []
ans = 0
list.append(A[0])
for i in range(1, len(A)):
ans += list[i - 1]
list.append(A[i])
list.append(A[i])
print(ans) | [
"expression.operation.binary.add"
] | 324,917 | 324,916 | u661764795 | python |
p02615 | N=int(input())
l=sorted(list(map(int,input().split())))
l.reverse()
s=l[0]-N%2*l[N//2]
for i in range(N//2):
s+=l[i+1]*2
print(s) | N=int(input())
l=sorted(list(map(int,input().split())))
l.reverse()
s=l[0]+N%2*l[N//2]
for i in range(N//2-1):
s+=l[i+1]*2
print(s) | [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 324,924 | 324,925 | u514118270 | python |
p02615 | n = int(input())
a = list(map(int, input().split(' ')))
def merge_sort(arr):
if len(arr) <= 1:
return arr
mid = len(arr) // 2
# ここで分割を行う
left = arr[:mid]
right = arr[mid:]
# 再帰的に分割を行う
left = merge_sort(left)
right = merge_sort(right)
# returnが返ってきたら、結合を行い、結合したものを次に渡す
... | n = int(input())
a = list(map(int, input().split(' ')))
def merge_sort(arr):
if len(arr) <= 1:
return arr
mid = len(arr) // 2
# ここで分割を行う
left = arr[:mid]
right = arr[mid:]
# 再帰的に分割を行う
left = merge_sort(left)
right = merge_sort(right)
# returnが返ってきたら、結合を行い、結合したものを次に渡す
... | [
"expression.operation.binary.remove"
] | 324,942 | 324,943 | u719260857 | python |
p02615 | from sys import stdin
N = int(stdin.readline().rstrip())
ran = [int(x) for x in stdin.readline().rstrip().split()]
ran.sort(reverse=True)
gen = len(ran) - 2
goukei = ran[0]
if gen % 2 == 0:
for i in range(int(gen/2)):
goukei += 2 * ran[i + 1]
else:
for i in rangen(int((gen-1)/2)):
goukei += 2 * ran[i + 1]
... | from sys import stdin
N = int(stdin.readline().rstrip())
ran = [int(x) for x in stdin.readline().rstrip().split()]
ran.sort(reverse=True)
gen = len(ran) - 2
goukei = ran[0]
if gen % 2 == 0:
for i in range(int(gen/2)):
goukei += 2 * ran[i + 1]
else:
for i in range(int((gen-1)/2)):
goukei += 2 * ran[i + 1]
... | [
"identifier.change",
"call.function.change"
] | 324,955 | 324,956 | u756607246 | python |
p02615 | # -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue
input = sys.stdin.readline
def inputInt(... | # -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue
input = sys.stdin.readline
def inputInt(... | [
"call.add"
] | 324,959 | 324,960 | u448994613 | python |
p02615 | from collections import deque
N = int(input())
A = list(map(int, input().split()))
A_sorted = sorted(A, reverse=True)
ans = 0
queue = deque([A_sorted[0]])
for a in A[1:]:
ans += queue.popleft()
queue.append(a)
queue.append(a)
print(ans)
| from collections import deque
N = int(input())
A = list(map(int, input().split()))
A_sorted = sorted(A, reverse=True)
ans = 0
queue = deque([A_sorted[0]])
for a in A_sorted[1:]:
ans += queue.popleft()
queue.append(a)
queue.append(a)
print(ans)
| [
"identifier.change"
] | 325,009 | 325,010 | u471214054 | python |
p02615 | def main():
N = int(input())
lst = sorted([int(i) for i in input().split()], reverse=True)
ans = lst[0]
n, m = divmod(N - 2, 2)
ans += sum(lst[1:n + 1]) * 2
if m:
ans += lst[n + 2]
print(ans)
if __name__ == '__main__':
main() | def main():
N = int(input())
lst = sorted([int(i) for i in input().split()], reverse=True)
ans = lst[0]
n, m = divmod(N - 2, 2)
ans += sum(lst[1:n + 1]) * 2
if m:
ans += lst[n + 1]
print(ans)
if __name__ == '__main__':
main() | [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 325,013 | 325,014 | u307622233 | python |
p02615 | N = int(input())
A_i = list(map(int, input().split()))
forret = sorted(A_i)
ret = A_i[-1]
for i in range(N-2):
ret = ret + forret[-1-1-(i//2)]
print(ret)
| N = int(input())
A_i = list(map(int, input().split()))
forret = sorted(A_i)
ret = forret[-1]
for i in range(N-2):
ret = ret + forret[-1-1-(i//2)]
print(ret)
| [
"assignment.value.change",
"identifier.change"
] | 325,024 | 325,025 | u893178798 | python |
p02615 | n = int(input())
a = list(map(int,input().split()))
a.sort(reverse = True)
c = n - 2
ans = a[0]
idx = 1
while c > 0:
ans += a[idx] * min(c,2)
idx += min(c,2)
c -= min(c,2)
print(ans) | n = int(input())
a = list(map(int,input().split()))
a.sort(reverse = True)
c = n - 2
ans = a[0]
idx = 1
while c > 0:
ans += a[idx] * min(c,2)
idx += 1
c -= min(c,2)
print(ans) | [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change"
] | 325,032 | 325,033 | u924406834 | python |
p02615 | n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
ans = 0
if len(a) % 2 == 0:
b = a[:len(a)//2]
ans = 2 * sum(b) - b[0]
else:
print(1)
b = a[:len(a)//2 +1]
ans = 2 * sum(b) - b[0] - b[-1]
print(ans) | n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
ans = 0
if len(a) % 2 == 0:
b = a[:len(a)//2]
ans = (2 * sum(b)) - b[0]
else:
b = a[:len(a)//2 +1]
ans = 2 * sum(b) - b[0] - b[-1]
print(ans) | [
"call.arguments.change",
"call.remove"
] | 325,038 | 325,039 | u087414215 | python |
p02615 | N = int(input())
A = list(map(int, input().split()))
sA = sorted(A, reverse=True)
if N % 2 == 0:
res = sum(sA[:N//2]) * 2 - sA[0]
else:
res = sum(sA[:N//2]) * 2 - sA[0] + sA[N//2+1]
print(res) | N = int(input())
A = list(map(int, input().split()))
sA = sorted(A, reverse=True)
if N % 2 == 0:
res = sum(sA[:N//2]) * 2 - sA[0]
else:
res = sum(sA[:N//2]) * 2 - sA[0] + sA[N//2]
print(res) | [
"expression.operation.binary.remove"
] | 325,073 | 325,074 | u811612390 | python |
p02615 | n = int(input())
coms = list(map(int, input().split()))
sr = sorted(coms)
ans = 0
for i in range(n - 1):
if i == 0:
ans += sr[0]
else:
nth = (i + 1) // 2
ans += sr[nth]
print(ans) | n = int(input())
coms = list(map(int, input().split()))
sr = sorted(coms, reverse=True)
ans = 0
for i in range(n-1):
if i == 0:
ans += sr[0]
else:
nth = (i + 1) // 2
ans += sr[nth]
print(ans) | [
"call.arguments.add"
] | 325,091 | 325,092 | u966584145 | python |
p02615 | N = int(input())
A = list(map(int,input().split()))
A = sorted(A)
ans = A[N//2:]
if N//2 == 0:
print(sum(ans)*2 - max(ans))
else:
print(sum(ans)*2 - max(ans) - min(ans)) | N = int(input())
A = list(map(int,input().split()))
A = sorted(A)
ans = A[N//2:]
if N%2 == 0:
print(sum(ans)*2 - max(ans))
else:
print(sum(ans)*2 - max(ans) - min(ans))
| [
"expression.operator.arithmetic.change",
"control_flow.branch.if.condition.change"
] | 325,099 | 325,100 | u304590784 | python |
p02615 | # /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from math import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key
INF=1001001001
__MOD__=(10*... | # /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from math import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key
INF=1001001001
__MOD__=(10*... | [
"expression.operation.binary.add"
] | 325,101 | 325,102 | u103136263 | python |
p02615 | n = int(input())
goods = [int(x) for x in input().split()]
goods.sort(reverse=True)
score = 0
if len(goods) % 2 == 0:
r = int(len(goods) / 2)
score += goods[0]
for i in range(1, r):
score += goods[i] * 2
else:
r = int((len(goods) - 1) / 2)
score += goods[0]
score += goods[r + 1]
... | n = int(input())
goods = [int(x) for x in input().split()]
goods.sort(reverse=True)
score = 0
if len(goods) % 2 == 0:
r = int(len(goods) / 2)
score += goods[0]
for i in range(1, r):
score += goods[i] * 2
else:
r = int((len(goods) - 1) / 2)
score += goods[0]
score += goods[r]
f... | [
"expression.operation.binary.remove"
] | 325,108 | 325,109 | u268674745 | python |
p02615 | def main():
n = int(input())
comp = list(map(int, input().split()))
comp.sort(reverse=True)
fin = n - 2
p = comp[0]
for i in range(1, n):
if fin == 1:
p += comp[i+1]
break
elif fin == 0:
break
p += comp[i]*2
fin -= 2
... | def main():
n = int(input())
comp = list(map(int, input().split()))
comp.sort(reverse=True)
fin = n - 2
p = comp[0]
for i in range(1, n):
if fin == 1:
p += comp[i]
break
elif fin == 0:
break
p += comp[i]*2
fin -= 2
pr... | [
"expression.operation.binary.remove"
] | 325,120 | 325,121 | u488670118 | python |
p02615 | n = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
ans += A[0]
if n > 2:
ans += sum(A[1:(n+1) // 2]) * 2
if n % 2 == 1:
ans -= A[(n+1) // 2]
print(ans) | n = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
ans += A[0]
if n > 2:
# print((n+1) // 2, A[1:(n+1) // 2])
ans += sum(A[1:(n+1) // 2]) * 2
if n % 2 == 1:
ans -= A[(n+1) // 2 - 1]
print(ans) | [
"expression.operation.binary.add"
] | 325,122 | 325,123 | u531631168 | python |
p02615 | N = int(input())
a = list(map(int,input().split()))
total=0
list.sort(a, reverse=True)
print(a)
if N %2== 0:
for i in range(int(N/2)):
if i == 0:
total += a[i]
else:
total += a[i]*2
else:
for i in range(int((N-1)/2)):
if i == 0:
total += a[i]
else:
total += a[i]*2
total += a[int((N-1)/2)]
print(... | N = int(input())
a = list(map(int,input().split()))
total=0
list.sort(a, reverse=True)
if N %2== 0:
for i in range(int(N/2)):
if i == 0:
total += a[i]
else:
total += a[i]*2
else:
for i in range(int((N-1)/2)):
if i == 0:
total += a[i]
else:
total += a[i]*2
total += a[int((N-1)/2 )]
print(total)
| [
"call.remove"
] | 325,136 | 325,137 | u916242112 | python |
p02615 | N = int(input())
a = list(map(int,input().split()))
total=0
list.sort(a, reverse=True)
if N %2== 0:
for i in range(int(N/2)):
if i == 0:
total += a[i]
else:
total += a[i]*2
else:
for i in range(int((N-1)/2)):
if i == 0:
total += a[i]
else:
total += a[i]*2
total += a[int(N/2 - 1)]
print(total)
| N = int(input())
a = list(map(int,input().split()))
total=0
list.sort(a, reverse=True)
if N %2== 0:
for i in range(int(N/2)):
if i == 0:
total += a[i]
else:
total += a[i]*2
else:
for i in range(int((N-1)/2)):
if i == 0:
total += a[i]
else:
total += a[i]*2
total += a[int((N-1)/2 )]
print(total)
| [
"call.arguments.change",
"expression.operation.binary.remove",
"call.arguments.add"
] | 325,138 | 325,137 | u916242112 | python |
p02615 | n = int(input())
x= [int(x) for x in input().split()]
x.sort(reverse=True)
c = 0
if n%2 == 0:
t = (n-2)//2
print(x[n//2] + sum(x[0:t]) + sum(x[1:t+1]))
if n%2 == 1:
t = (n-1)//2
print(sum(x[0:t]) + sum(x[1:t+1])) | n = int(input())
x= [int(x) for x in input().split()]
x.sort(reverse=True)
c = 0
if n%2 == 0:
t = (n-2)//2
print(x[n//2-1] + sum(x[0:t]) + sum(x[1:t+1]))
#print(x[n//2] ,x[0:t], x[1:t+1] )
if n%2 == 1:
t = (n-1)//2
print(sum(x[0:t]) + sum(x[1:t+1])) | [
"expression.operation.binary.add"
] | 325,155 | 325,156 | u632423548 | python |
p02615 | import sys
sys.setrecursionlimit(10**9)
def main():
n = int(input())
a = list(map(int, input().split()))
print(a)
a.sort(reverse=True)
ans = 0
for i in range(0, n-1):
now_index = (i+1) // 2
ans += a[now_index]
print(ans)
return
if __name__ == "__main__":
main()
... | import sys
sys.setrecursionlimit(10**9)
def main():
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
for i in range(0, n-1):
now_index = (i+1) // 2
ans += a[now_index]
print(ans)
return
if __name__ == "__main__":
main()
sys.exit(... | [
"call.remove"
] | 325,175 | 325,176 | u054871430 | python |
p02615 | N = int(input())
a = list(map(int, input().split()))
b = sorted(a)[::-1]
if N == 1:
print(a[0])
elif N == 2:
print(a[0])
elif N > 2 and N % 2 == 0:
print(b[0] + sum(b[1:N//2]) * 2)
elif N > 2 and N % 2 == 1:
print(b[0] + sum(b[1:(N-1)//2]) * 2 + b[-1])
| N = int(input())
a = list(map(int, input().split()))
b = sorted(a)[::-1]
if N == 1:
print(a[0])
elif N == 2:
print(a[0])
elif N > 2 and N % 2 == 0:
print(b[0] + sum(b[1:N // 2]) * 2)
elif N > 2 and N % 2 == 1:
print(b[0] + sum(b[1:(N - 1) // 2]) * 2 + b[(N - 1) // 2])
| [
"expression.operation.binary.add"
] | 325,185 | 325,186 | u033566567 | python |
p02615 | #!/usr/bin/env python3
n, *a = map(int, open(0).read().split())
a.sort(reverse=1)
print(sum(a[:0--n // 2]) * 2 - max(a) - a[n // 2] * n % 2) | #!/usr/bin/env python3
n, *a = map(int, open(0).read().split())
a.sort(reverse=1)
print(sum(a[:0--n // 2]) * 2 - max(a) - a[n // 2] * (n % 2)) | [
"call.arguments.change"
] | 325,198 | 325,199 | u373047809 | python |
p02615 | from math import floor,ceil,sqrt
import fractions
from collections import deque
import itertools
from collections import deque
import collections
from heapq import *
import json
l=[]
N=int(input())
A=list(map(int,input().split()))
c=collections.Counter(A)
values=list(c.values()) #aのCollectionのvalue値のリスト(n_1こ、n_2こ…)
key... | from math import floor,ceil,sqrt
import fractions
from collections import deque
import itertools
from collections import deque
import collections
from heapq import *
import json
l=[]
N=int(input())
A=list(map(int,input().split()))
c=collections.Counter(A)
values=list(c.values()) #aのCollectionのvalue値のリスト(n_1こ、n_2こ…)
key... | [
"assignment.value.change",
"identifier.change",
"call.function.change",
"expression.operation.binary.change"
] | 325,208 | 325,209 | u995004106 | python |
p02615 | n = int(input())
ls = list(map(int,input().split()))
ls= sorted(ls,reverse=True)
ans = ls[0]
for i in range(2,n):
ans += ls[i//2+1]
print(ans) | n = int(input())
ls = list(map(int,input().split()))
ls= sorted(ls,reverse=True)
ans = ls[0]
for i in range(2,n):
ans += ls[i//2]
print(ans) | [
"expression.operation.binary.remove"
] | 325,275 | 325,276 | u115110170 | python |
p02615 | N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
Sum = 0
for i in range(N-1):
if i < 2:
Sum += A[i]
else:
Sum += A[(i+2)//2]
print(Sum) | N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
Sum = 0
for i in range(N-1):
if i == 0:
Sum += A[i]
else:
Sum += A[(i+1)//2]
#print(A[(i+1)//2])
print(Sum) | [
"control_flow.loop.for.condition.change",
"literal.number.integer.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 325,311 | 325,312 | u698902360 | python |
p02615 | n = int(input())
c = list(map(int, input().split()))
c.sort(reverse = True)
a = 0
for i in range(int(n//2+1)):
a += c[i]
if n%2==0:
print(a*2-c[0])
else:
print(a*2-c[0]-c[n//2]) | n = int(input())
c = list(map(int, input().split()))
c.sort(reverse = True)
a = 0
for i in range(int((n+1)//2)):
a += c[i]
if n%2==0:
print(a*2-c[0])
else:
print(a*2-c[0]-c[n//2]) | [
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"expression.operation.binary.remove"
] | 325,325 | 325,326 | u525589885 | python |
p02615 | n=int(input())
a=list(map(int,input().split()))
aa = sorted(a,reverse=True)
print(aa)
ans=0
if n%2 == 0:
for i in range(n//2):
ans = aa[i]*2+ans
else:
for i in range((n+1)//2):
ans = aa[i]*2+ans
ans = ans - aa[(n-1)//2]
ans = ans - aa[0]
print(ans) | n=int(input())
a=list(map(int,input().split()))
aa = sorted(a,reverse=True)
ans=0
if n%2 == 0:
for i in range(n//2):
ans = aa[i]*2+ans
else:
for i in range((n+1)//2):
ans = aa[i]*2+ans
ans = ans - aa[(n-1)//2]
ans = ans - aa[0]
print(ans)
| [
"call.remove"
] | 325,341 | 325,342 | u516483179 | python |
p02615 | # Contest No.: ABC173
# Problem No.: D
# Solver: JEMINI
# Date: 20200705
import sys
import heapq
def main():
n = int(input())
nums = list(map(int, sys.stdin.readline().split()))
nums.sort()
ans = 0
# initial
temp = nums.pop()
ans += temp
n -= 2
for i in range(n /... | # Contest No.: ABC173
# Problem No.: D
# Solver: JEMINI
# Date: 20200705
import sys
import heapq
def main():
n = int(input())
nums = list(map(int, sys.stdin.readline().split()))
nums.sort()
ans = 0
# initial
temp = nums.pop()
ans += temp
n -= 2
for i in range(n /... | [
"expression.operation.binary.add"
] | 325,351 | 325,352 | u689377278 | python |
p02615 | n = int(input())
ns = list(map(int, input().split()))
ns = sorted(ns, reverse=True)
if n % 2 == 1:
a = n //2 + 1
print(a)
print(sum(ns[:a]) * 2 - ns[0] - ns[a-1])
else:
a = n // 2
print(sum(ns[:a]) * 2 - ns[0]) | n = int(input())
ns = list(map(int, input().split()))
ns = sorted(ns, reverse=True)
if n % 2 == 1:
a = n //2 + 1
print(sum(ns[:a]) * 2 - ns[0] - ns[a-1])
else:
a = n // 2
print(sum(ns[:a]) * 2 - ns[0]) | [
"call.remove"
] | 325,353 | 325,354 | u891217808 | python |
p02615 | from collections import defaultdict as dd
import heapq
N = int(input())
a = list(map(int,input().split()))
res = 0
a = sorted(a, reverse=True)
dic=dd(list)
ls = [a[0]]
heapq.heapify(ls)
for val in a[1:]:
tmp = heapq.heappop(ls)
res += tmp
heapq.heappush(ls,val)
heapq.heappush(ls,val)
print(res) | from collections import defaultdict as dd
import heapq
N = int(input())
a = list(map(int,input().split()))
res = 0
a = sorted(a, reverse=True)
dic=dd(list)
ls = [-a[0]]
heapq.heapify(ls)
for val in a[1:]:
tmp = -heapq.heappop(ls)
res += tmp
heapq.heappush(ls,-val)
heapq.heappush(ls,-val)
print(res) | [
"expression.operation.unary.add",
"call.arguments.change"
] | 325,368 | 325,369 | u871980676 | python |
p02615 | N = int(input())
A = list(map(int, input().split()))
A_sorted = sorted(A,reverse = True)
import heapq
circle = []
heapq.heappush(circle, -A_sorted[1])
heapq.heappush(circle, -A_sorted[1])
answer = A_sorted[0]
for i in range(2,N):
target = A[i]
popped = heapq.heappop(circle)
answer -= popped
heapq.he... | import heapq
N = int(input())
A = list(map(int, input().split()))
A_sorted = sorted(A,reverse = True)
circle = []
heapq.heappush(circle, -A_sorted[1])
heapq.heappush(circle, -A_sorted[1])
answer = A_sorted[0]
for i in range(2,N):
target = A_sorted[i]
popped = heapq.heappop(circle)
answer -= popped
h... | [
"assignment.value.change",
"identifier.change"
] | 325,374 | 325,375 | u207097826 | python |
p02615 | def main():
n = int(input())
a=[int(i) for i in input().split()]
a.sort(reverse = True)
#隙間には2個入る
res = a[0]
tmp = a[1]
k = 1
cnt = 0
for i in range(2,n):
res += tmp
cnt+=1
if(cnt == 2):
k+=1
tmp = a[k]
print(res)
if __name__ == '... | def main():
n = int(input())
a=[int(i) for i in input().split()]
a.sort(reverse = True)
#隙間には2個入る
res = a[0]
tmp = a[1]
k = 1
cnt = 0
for i in range(2,n):
res += tmp
cnt+=1
if(cnt == 2):
k+=1
tmp = a[k]
cnt = 0
print(re... | [
"assignment.add"
] | 325,391 | 325,392 | u685983477 | python |
p02615 | n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
ans = 0
for i in range(n):
if i==0:
ans += 0
elif i == 1:
ans += a[0]
else:
ans += a[i//2 + 1]
print(ans) | n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
ans = 0
for i in range(n):
if i==0:
ans += 0
elif i == 1:
ans += a[0]
else:
ans += a[i//2]
print(ans) | [
"expression.operation.binary.remove"
] | 325,405 | 325,406 | u860657719 | python |
p02615 | #!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
import heapq
def resolve():
N,=pin()
A=[*pin()]
A.sort(reverse=T... | #!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
import heapq
def resolve():
N,=pin()
A=[*pin()]
A.sort(reverse=T... | [
"call.remove"
] | 325,413 | 325,414 | u857428111 | python |
p02615 | N = int(input())
A = sorted(list(map(int, input().split())))[::-1]
ans = A[0]
if (N-2)%2==0:
for i in range((N-2)//2):
ans+=A[i+1]*2
else:
for i in range((N-2)//2):
ans+=A[i+1]*2
ans+=A[(N-1)//2+1]
print(ans) | N = int(input())
A = sorted(list(map(int, input().split())))[::-1]
ans = A[0]
if (N-2)%2==0:
for i in range((N-2)//2):
ans+=A[i+1]*2
else:
for i in range((N-2)//2):
ans+=A[i+1]*2
ans+=A[(N-2)//2+1]
print(ans)
| [
"literal.number.integer.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 325,419 | 325,420 | u090266528 | python |
p02615 | import collections
n = int(input())
a = list(map(int, input().split()))
a.sort()
a.reverse()
b = collections.Counter(a)
c = list(b.items())
now = 0
tnp = 1
l = 0
l += c[0][1]
if (l>=n-1):
print(c[0][0]*(n-1))
exit()
now = l*c[0][0]
while True:
if (l+c[tnp][1]*2>=n-1):
print(now + (n-l-1)*c[tnp][0])
... | import collections
n = int(input())
a = list(map(int, input().split()))
a.sort()
a.reverse()
b = collections.Counter(a)
c = list(b.items())
now = 0
tnp = 1
l = 0
l += c[0][1]*2-1
if (l>=n-1):
print(c[0][0]*(n-1))
exit()
now = l*c[0][0]
while True:
if (l+c[tnp][1]*2>=n-1):
print(now + (n-l-1)*c[tnp][... | [
"expression.operation.binary.add"
] | 325,433 | 325,434 | u262597910 | python |
p02615 | N = int(input())
A = [int(i) for i in input().split()]
A.sort(reverse=True)
ans = 0
if N%2 == 0:
ans = 2*sum(A[:N//2]) - A[0]
else:
ans = 2*sum(A[:(N//2+1)]) - A[0] - A[(N//2+1)]
print(ans) | N = int(input())
A = [int(i) for i in input().split()]
A.sort(reverse=True)
ans = 0
if N%2 == 0:
ans = 2*sum(A[:N//2]) - A[0]
else:
ans = 2*sum(A[:(N//2+1)]) - A[0] - A[N//2]
print(ans) | [] | 325,435 | 325,436 | u749359783 | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.