結果

問題 No.420 mod2漸化式
ユーザー 炭酸水
提出日時 2022-05-17 18:30:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 352 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-15 13:25:08
合計ジャッジ時間 2,710 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 33 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

x = int(input())

if x == 0 or 31 < x:
    print("0 0")
elif x == 31:
    print("1 2147483647")
elif x == 1:
    print("30 2147483646")
else:
    p = 1
    q = 1
    for i in range(31 - (x - 1),31):
        p *= i
    for i in range(1, x):
        q *= i
    
    ans_0 = p // q
    ans_1 = (p * 31) // (q * x)
    
    print(ans_1, ans_0 * 2147483647)
0