結果

問題 No.420 mod2漸化式
ユーザー 👑 KazunKazun
提出日時 2020-09-02 18:18:37
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 65 ms / 1,000 ms
コード長 234 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 71,588 KB
最終ジャッジ日時 2023-08-13 21:31:15
合計ジャッジ時間 4,116 ms
ジャッジサーバーID
(参考情報)
judge13 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,356 KB
testcase_01 AC 62 ms
71,196 KB
testcase_02 AC 61 ms
71,336 KB
testcase_03 AC 61 ms
71,284 KB
testcase_04 AC 62 ms
71,464 KB
testcase_05 AC 63 ms
71,064 KB
testcase_06 AC 60 ms
71,320 KB
testcase_07 AC 61 ms
71,284 KB
testcase_08 AC 61 ms
71,084 KB
testcase_09 AC 60 ms
71,260 KB
testcase_10 AC 62 ms
71,360 KB
testcase_11 AC 62 ms
71,572 KB
testcase_12 AC 61 ms
71,528 KB
testcase_13 AC 63 ms
71,100 KB
testcase_14 AC 62 ms
71,336 KB
testcase_15 AC 64 ms
71,236 KB
testcase_16 AC 63 ms
71,372 KB
testcase_17 AC 62 ms
71,588 KB
testcase_18 AC 63 ms
71,360 KB
testcase_19 AC 62 ms
71,320 KB
testcase_20 AC 62 ms
71,580 KB
testcase_21 AC 61 ms
71,576 KB
testcase_22 AC 62 ms
71,376 KB
testcase_23 AC 63 ms
71,124 KB
testcase_24 AC 63 ms
71,240 KB
testcase_25 AC 64 ms
71,236 KB
testcase_26 AC 62 ms
71,260 KB
testcase_27 AC 63 ms
71,100 KB
testcase_28 AC 62 ms
71,196 KB
testcase_29 AC 61 ms
71,280 KB
testcase_30 AC 61 ms
71,256 KB
testcase_31 AC 61 ms
71,320 KB
testcase_32 AC 61 ms
71,280 KB
testcase_33 AC 63 ms
71,364 KB
testcase_34 AC 65 ms
71,228 KB
testcase_35 AC 62 ms
71,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X=int(input())

if X>=32:
    print(0,0)
    exit()
elif X==0:
    print(1,0)
    exit()

a=b=1
for i in range(1,X+1):
    a*=31-(i-1)
    b*=i
P=a//b

c=d=1
for i in range(1,X):
    c*=30-(i-1)
    d*=i
Q=(c//d)*(2**31-1)

print(P,Q)
0