結果

問題 No.420 mod2漸化式
ユーザー brthyyjpbrthyyjp
提出日時 2021-03-14 01:39:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 168 ms / 1,000 ms
コード長 514 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 130,432 KB
最終ジャッジ日時 2024-04-23 14:30:53
合計ジャッジ時間 6,679 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
130,172 KB
testcase_01 AC 159 ms
130,432 KB
testcase_02 AC 162 ms
130,020 KB
testcase_03 AC 160 ms
130,388 KB
testcase_04 AC 159 ms
130,304 KB
testcase_05 AC 157 ms
130,088 KB
testcase_06 AC 39 ms
52,096 KB
testcase_07 AC 160 ms
130,268 KB
testcase_08 AC 160 ms
130,312 KB
testcase_09 AC 159 ms
130,412 KB
testcase_10 AC 160 ms
130,176 KB
testcase_11 AC 159 ms
130,432 KB
testcase_12 AC 159 ms
130,044 KB
testcase_13 AC 161 ms
130,432 KB
testcase_14 AC 160 ms
130,100 KB
testcase_15 AC 160 ms
130,276 KB
testcase_16 AC 160 ms
130,304 KB
testcase_17 AC 159 ms
130,432 KB
testcase_18 AC 161 ms
130,284 KB
testcase_19 AC 160 ms
130,088 KB
testcase_20 AC 159 ms
130,184 KB
testcase_21 AC 159 ms
130,148 KB
testcase_22 AC 160 ms
130,416 KB
testcase_23 AC 159 ms
130,224 KB
testcase_24 AC 159 ms
130,372 KB
testcase_25 AC 159 ms
130,176 KB
testcase_26 AC 161 ms
130,432 KB
testcase_27 AC 160 ms
130,224 KB
testcase_28 AC 159 ms
130,176 KB
testcase_29 AC 162 ms
129,956 KB
testcase_30 AC 168 ms
130,176 KB
testcase_31 AC 162 ms
130,000 KB
testcase_32 AC 159 ms
130,232 KB
testcase_33 AC 46 ms
52,224 KB
testcase_34 AC 37 ms
51,712 KB
testcase_35 AC 39 ms
51,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())
if x > 31:
    print(0, 0)
    exit()

if x == 0:
    print(1, 0)
    exit()

N = 10**3
C = [[0]*(N+1) for i in range(N+1)] #C[n][k] > nCk

for i in range(N+1):
    for j in range(i+1):
        if j == 0 or j == i:
            C[i][j] = 1
        else:
            C[i][j] = C[i-1][j-1]+C[i-1][j]

def cmb(n, k):
    return C[n][k]

table = [0]*33
table[0] = 1
for i in range(1, 33):
    table[i] = table[i-1]*2

c = cmb(31, x)
s = 0
for i in range(31):
    s += table[i]*cmb(30, x-1)
print(c, s)
0