結果

問題 No.554 recurrence formula
ユーザー mlihua09mlihua09
提出日時 2020-09-15 02:10:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 222 bytes
コンパイル時間 410 ms
コンパイル使用メモリ 86,516 KB
実行使用メモリ 154,084 KB
最終ジャッジ日時 2023-09-04 01:25:50
合計ジャッジ時間 6,744 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
75,428 KB
testcase_01 AC 78 ms
70,988 KB
testcase_02 AC 75 ms
71,108 KB
testcase_03 AC 76 ms
70,948 KB
testcase_04 AC 76 ms
70,680 KB
testcase_05 AC 75 ms
70,992 KB
testcase_06 AC 75 ms
70,920 KB
testcase_07 AC 79 ms
71,196 KB
testcase_08 AC 76 ms
71,080 KB
testcase_09 AC 75 ms
70,660 KB
testcase_10 WA -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 TLE -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

mod = 10 ** 9 + 7

x = 1
y = 0
if n == 1:
    print(1)
    exit()
for i in range(2, n - 1, 2):
    y += i * x
    x += (i + 1) * y

if n % 2:
    y += (n - 1) * x
    print(n * y)

else:
    print(n * x)
0