結果
| 問題 |
No.45 回転寿司
|
| ユーザー |
Shirapon_pon
|
| 提出日時 | 2021-11-03 17:14:53 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 587 bytes |
| コンパイル時間 | 351 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 16,384 KB |
| 最終ジャッジ日時 | 2024-10-13 07:28:40 |
| 合計ジャッジ時間 | 12,880 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | TLE * 1 -- * 29 |
ソースコード
import copy
n = int(input())
k = [int(x) for x in input().split()]
def func(num,num_list):
total = 0
a = [0,0]
if num == 1:
total = num_list[0]
elif num == 2:
total = max(num_list[0],num_list[1])
elif num == 0:
total = 0
else:
for i in range(2):
a[i] += num_list[i]
num2 = num - (i+2)
ls = copy.copy(num_list)
for _ in range(i+2):
ls.pop(0)
a[i] += func(num2,ls)
total = max(a[0],a[1])
return total
print(func(n,k))
Shirapon_pon