結果

問題 No.2835 Take and Flip
ユーザー detteiuudetteiuu
提出日時 2024-08-09 21:24:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 82,548 KB
実行使用メモリ 109,096 KB
最終ジャッジ日時 2024-08-09 21:24:57
合計ジャッジ時間 3,584 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = sorted(list(map(int, input().split())))

first, second = 0, 0
for i in range(N//2):
    second += -A[i]
for i in range(N//2, N):
    first += A[i]

print(first-second)
0