結果

問題 No.44 DPなすごろく
ユーザー CsTarepanda
提出日時 2017-05-03 22:14:48
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 412 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-14 07:10:57
合計ジャッジ時間 1,793 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
cnt = 0

def mult(*n):
    result = 1
    for i in n:
        result *= n
    return result

def conb(l, r):
    if r == 0: return 1
    result = 1
    for x in range(l, l - r, -1):
        result *= x
    for x in range(2, r + 1):
        result /= x
    return result


result = 0
while True:
    result += conb(n, cnt)
    cnt += 1
    n -= 1
    if cnt > n:
        break
print(int(result))
0