結果
| 問題 |
No.3268 As Seen in Toasters
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-12 22:18:16 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 238 bytes |
| コンパイル時間 | 300 ms |
| コンパイル使用メモリ | 82,512 KB |
| 実行使用メモリ | 119,992 KB |
| 最終ジャッジ日時 | 2025-09-12 23:41:49 |
| 合計ジャッジ時間 | 9,843 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 WA * 13 |
ソースコード
from collections import*
n,*a=map(int,open(0).read().split())
a.sort(key=abs)
last=[a.pop(),a.pop()]
a.sort()
q=[last.pop()]+sorted(a)+[last.pop()]
s=0
for i,j in zip(q,q[1:]):
if i<0 and j<0:
s-=i+j
else:
s+=abs(i-j)
print(s)