結果
| 問題 |
No.45 回転寿司
|
| ユーザー |
|
| 提出日時 | 2017-01-07 20:03:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 416 bytes |
| コンパイル時間 | 266 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-12-17 17:08:52 |
| 合計ジャッジ時間 | 2,140 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 1 WA * 21 RE * 8 |
ソースコード
N = int(input())
V = list(map(int,input().split()))
V.extend([0,0,0])
value = 0
key = 0
for i in range(len(V)-2):
if key == 2:
key = 1
continue
if key == 1:
key = 0
continue
else:
if V[i+1]+V[i+3] > V[i]+V[i+2] and V[i+1]+V[i+3] > V[i]+V[i+3]:
value += V[i+1]
key = 2
else:
value += V[i]
key = 1
print(value)