結果
問題 |
No.45 回転寿司
|
ユーザー |
|
提出日時 | 2017-08-25 14:18:40 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 269 bytes |
コンパイル時間 | 62 ms |
コンパイル使用メモリ | 6,820 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-15 15:39:26 |
合計ジャッジ時間 | 1,641 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 1 WA * 29 |
ソースコード
n = input() arr = map(int, raw_input().split()) maxes = [] while sum(arr) != 0: mx = arr.index(max(arr)) maxes.append(arr[mx]) arr[mx] = 0 if mx - 1 >= 0: arr[mx - 1] = 0 if mx + 1 < len(arr): arr[mx + 1] = 0 print sum(maxes)