結果

問題 No.554 recurrence formula
ユーザー trineutrontrineutron
提出日時 2021-01-04 03:53:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 189 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 16,984 KB
最終ジャッジ日時 2024-04-21 23:02:13
合計ジャッジ時間 4,682 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
15,872 KB
testcase_01 AC 31 ms
10,496 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
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())
odd, even = 1, 0
for i in range(2, n + 1):
    if i % 2 == 0:
        even += i * odd
    else:
        odd += i * even
if n % 2 == 0:
    print(even)
else:
    print(odd)
0