結果
| 問題 |
No.420 mod2漸化式
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-28 20:08:21 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 1,000 ms |
| コード長 | 278 bytes |
| コンパイル時間 | 147 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-11-28 20:08:23 |
| 合計ジャッジ時間 | 2,071 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 35 |
ソースコード
import math
def comb(n, x):
return math.factorial(n) // math.factorial(x) // math.factorial(n-x)
x = int(input())
n = 31
if x == 0:
print(1, 0)
exit()
elif x > 31:
print(0, 0)
exit()
a = comb(n, x)
b = comb(30, x-1)
c = (pow(2, 31) - 1) * b
print(a, c)