結果
| 問題 | No.45 回転寿司 |
| ユーザー |
1235486527
|
| 提出日時 | 2019-11-27 13:13:04 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 505 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-09-21 00:47:46 |
| 合計ジャッジ時間 | 2,856 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 2 WA * 28 |
ソースコード
N = int(input())
V = tuple(map(int, input().split()))
s = 0
e = False
if N > 2:
for i in range(N-1, 1, -1):
if e:
if V[i-2] > V[i-1]:
e = True
else:
e = False
else:
if V[i] + V[i-2] > V[i-1]:
s += V[i]
e = True
else:
e = False
else:
if e:
s += V[0]
else:
s += max(V[0], V[1])
print(s)
else:
print(max(V))
1235486527