結果
問題 |
No.2835 Take and Flip
|
ユーザー |
![]() |
提出日時 | 2024-08-09 21:48:19 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 476 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 17,932 KB |
最終ジャッジ日時 | 2024-08-09 21:48:22 |
合計ジャッジ時間 | 2,363 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | AC * 2 RE * 20 |
ソースコード
N = int(input()) num_list = [] for i in range(N): s = int(input()) num_list.append(s) x_list=[] y_list=[] num_list.sort(reverse=True) while len(num_list)>0: num_list.sort(reverse=True) x_list.append(num_list.pop(0)) num_list =[n*-1 for n in num_list] if len(num_list) >0: num_list.sort(reverse=True) y_list.append(num_list.pop(0)) num_list =[n*-1 for n in num_list] X_sum = sum(x_list) Y_sum = sum(y_list) print(X_sum - Y_sum)