結果
問題 |
No.554 recurrence formula
|
ユーザー |
|
提出日時 | 2017-08-22 04:03:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 282 bytes |
コンパイル時間 | 95 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 17,016 KB |
最終ジャッジ日時 | 2024-10-15 01:03:22 |
合計ジャッジ時間 | 15,168 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 TLE * 3 -- * 1 |
ソースコード
n=int(input()) R={1:1,2:2,3:6} def f(x): if x==1:return R[1] k=0 if x%2==0: for y in range(1,x,2):k+=R[y] else: for y in range(2,x,2):k+=R[y] R[x]=k*x%(10**9+7) return R[x] for i in range(1,n):f(i) # print(i,f(i)) print(f(n)%(10**9+7))