結果

問題 No.420 mod2漸化式
コンテスト
ユーザー ヒッキープログラミングするスレ
提出日時 2016-09-09 23:52:54
言語 Python3
(3.14.2 + numpy 2.4.0 + scipy 1.16.3)
結果
WA  
実行時間 -
コード長 389 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 449 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-16 18:47:30
合計ジャッジ時間 2,663 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 17 WA * 15 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#code

def combi(n, k):
    x = n
    r = 1
    for i in range(1, min(31 - k, k) + 1):
        r *= x
        r //= i
        x -= 1
    return r

x = int(input())

assert x < 32

if x == 0:
    print(1, 0)
else:
    ans_count = combi(31, x)
    ans_sum = 0
    multi = combi(30, x - 1)
    for i in range(31):
        t = 1 << i
        ans_sum += t * multi
    print(ans_count, ans_sum)
0