結果
| 問題 | 
                            No.1687 What the Heck?
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-09-24 21:56:45 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,635 bytes | 
| コンパイル時間 | 158 ms | 
| コンパイル使用メモリ | 81,920 KB | 
| 実行使用メモリ | 96,640 KB | 
| 最終ジャッジ日時 | 2024-07-05 10:31:44 | 
| 合計ジャッジ時間 | 2,896 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 1 | 
| other | AC * 1 WA * 17 | 
ソースコード
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()
	print(sum(a[n//2:])-sum(a[:n//2]))