結果
| 問題 | 
                            No.420 mod2漸化式
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-05-17 18:39:34 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 352 bytes | 
| コンパイル時間 | 94 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-09-15 13:34:32 | 
| 合計ジャッジ時間 | 2,257 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge6 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 32 WA * 3 | 
ソースコード
x = int(input())
if x == 0 or 31 < x:
    print("1 0")
elif x == 31:
    print("1 2147483647")
elif x == 1:
    print("31 2147483647")
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)