結果

問題 No.554 recurrence formula
ユーザー momotaros300momotaros300
提出日時 2019-09-03 10:09:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 174 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 76,612 KB
最終ジャッジ日時 2023-08-25 00:02:23
合計ジャッジ時間 7,339 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 72 ms
71,380 KB
testcase_02 AC 71 ms
71,424 KB
testcase_03 AC 76 ms
71,160 KB
testcase_04 AC 71 ms
71,156 KB
testcase_05 AC 72 ms
71,116 KB
testcase_06 AC 71 ms
71,380 KB
testcase_07 AC 71 ms
71,192 KB
testcase_08 AC 71 ms
70,988 KB
testcase_09 AC 71 ms
71,308 KB
testcase_10 AC 81 ms
75,780 KB
testcase_11 AC 147 ms
76,348 KB
testcase_12 AC 126 ms
76,304 KB
testcase_13 AC 311 ms
76,612 KB
testcase_14 AC 147 ms
76,400 KB
testcase_15 AC 357 ms
76,288 KB
testcase_16 AC 420 ms
76,476 KB
testcase_17 AC 232 ms
76,404 KB
testcase_18 AC 203 ms
76,528 KB
testcase_19 TLE -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
mod=10**9+7
even,odd=0,1
for i in range(2,n):
	if i%2==0:
		even+=odd*i
		even%mod
	else:
		odd+=even*i
		odd%mod
print(even*n%mod if n%2 else odd*n%mod)





0