結果

問題 No.1687 What the Heck?
ユーザー ZZZZZZ
提出日時 2021-09-24 21:50:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,666 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 98,308 KB
最終ジャッジ日時 2023-09-18 21:11:58
合計ジャッジ時間 4,821 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
76,840 KB
testcase_01 AC 135 ms
76,888 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from bisect import *
from collections import deque
#from functools import *
#from fractions import Fraction as f
from copy import *	
from heapq import *
from math import sqrt
from itertools import permutations as prm,product
from random import *
def eprint(*args):
    print(*args, file=sys.stderr)
zz=1
 
sys.setrecursionlimit(10**5)
if zz:
	input=sys.stdin.readline
else:	
	sys.stdin=open('input.txt', 'r')
	sys.stdout=open('all.txt','w')
di=[[-1,0],[1,0],[0,1],[0,-1]]

def fori(n):
	return [fi() for i in range(n)]	
def inc(d,c,x=1):
	d[c]=d[c]+x if c in d else x
def ii():
	return input().rstrip()	
def li():
	return [int(xx) for xx in input().split()]
def fli():
	return [float(x) for x in input().split()]	
def dadd(d,p,val):
	if p in d:
		d[p].append(val)
	else:
		d[p]=[val]		
def gi():	
	return [xx for xx in input().split()]
def gtc(tc,*ans):
	print("Case #"+str(tc)+":",*ans)	
def cil(n,m):
	return n//m+int(n%m>0)	
def fi():
	return int(input())
def pro(a): 
	return reduce(lambda a,b:a*b,a)		
def swap(a,i,j): 
	a[i],a[j]=a[j],a[i]	
def bits(i,n):
	p=bin(i)[2:]
	return (n-len(p))*"0"+p	
def prec(a,pre):
	for i in a:
		pre.append(pre[-1]+i)
	pre.pop(0)	
def YN(flag):
	print("YES" if flag else "NO")	
def si():
	return list(input().rstrip())	
def mi():
	return 	map(int,input().split())			
def gh():
	sys.stdout.flush()
def isvalid(i,j,n,m):
	return 0<=i<n and 0<=j<m 
def bo(i):
	return ord(i)-ord('a')	
def graph(n,m):
	for i in range(m):
		x,y=mi()
		a[x].append(y)
		a[y].append(x)


t=1
INF=10**18
uu=t
mod=10**9+7


       
while t>0:
	t-=1
	n=fi()
	a=li()
	a.sort()
	ans=0
	for i in range(n//2):
		ans+=2*(a[n-i-1]-a[i])
	print(ans)	
0