結果

問題 No.3066 Collecting Coins Speedrun 1
ユーザー i_taku
提出日時 2025-03-25 16:05:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 82,752 KB
実行使用メモリ 83,052 KB
最終ジャッジ日時 2025-03-25 16:06:03
合計ジャッジ時間 4,211 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
C = list(map(int, input().split()))
ans = 0
if C[0] < 0 and C[-1] > 0:
    ans = -C[0] * 2 + C[-1] * 2
elif C[0] < 0:
    ans = -C[0] * 2
else:
    ans = C[-1] * 2
print(ans)
0