結果

問題 No.786 京都大学の過去問
ユーザー Fukuso_SutaroFukuso_Sutaro
提出日時 2019-03-14 23:07:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 8,088 KB
最終ジャッジ日時 2023-09-09 16:51:05
合計ジャッジ時間 879 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def perm(a, b):
    return math.factorial(a + b) / (math.factorial(a) * math.factorial(b))

print("段数")
x = input()
N = int(x)
combi = 0

if N % 2 == 0:
    for n in range(int(N / 2) + 1):
        combi = combi + perm((2 * n), int((N - (2 * n)) / 2))
else:
    for n in range(int((N + 1) / 2)):
        combi = combi + perm(((2 * n) + 1), int((N - (2 * n)) / 2))
        
print(combi)
0