結果
| 問題 |
No.45 回転寿司
|
| ユーザー |
NiER_Replicant6
|
| 提出日時 | 2017-12-27 00:02:19 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 5,000 ms |
| コード長 | 340 bytes |
| コンパイル時間 | 205 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-12-27 17:49:19 |
| 合計ジャッジ時間 | 2,298 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
n=int(input())
m=list(map(int,input().split()))
list1=[0]*n
list1[0]=m[0]
if n>2:
list1[1]=max(list1[0],m[1])
for i in range(n-2):
list1[i+2]=max(list1[i]+m[i+2],list1[i+1])
print(max(list1))
elif n==1:
list1[0]=max(list1[0],m[0])
print(list1[0])
elif n==2:
list1[0]=max(list1[0],m[0])
print(list1[0])
NiER_Replicant6