結果
| 問題 | No.420 mod2漸化式 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-10 09:11:13 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 21 ms / 1,000 ms |
| + 355µs | |
| コード長 | 568 bytes |
| 記録 | |
| コンパイル時間 | 54 ms |
| コンパイル使用メモリ | 15,232 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-10-08 08:04:16 |
| 合計ジャッジ時間 | 2,738 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 35 |
ソースコード
import sys
from math import factorial
def debug(x, table):
for name, val in table.items():
if x is val:
print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
return None
def binom(n, r):
return factorial(n) // (factorial(n - r) * factorial(r))
def solve():
x = int(input())
if x >= 32:
print(0,0)
return
elif x == 0:
print(1,0)
return
sum2 = 2**31 - 1
comb = binom(31, x)
tot = sum2 * binom(30, x-1)
print(comb, tot)
if __name__ == '__main__':
solve()