結果
問題 |
No.554 recurrence formula
|
ユーザー |
![]() |
提出日時 | 2017-08-11 23:33:47 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 326 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 31,908 KB |
最終ジャッジ日時 | 2024-10-12 22:02:07 |
合計ジャッジ時間 | 4,263 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 TLE * 1 -- * 9 |
ソースコード
def func(n,li): ans=0 if n==1: return 1 elif n==2: return 2 elif n%2==0: sub_li=li[0::2] return n*sum(sub_li) else: sub_li=li[1::2] return n*sum(sub_li) m=int(input()) mymod=10**9+7 li=[] for a in range(1,m): li.append(func(a,li)) print(func(m,li)%mymod)