結果
問題 | No.420 mod2漸化式 |
ユーザー |
![]() |
提出日時 | 2020-05-16 22:34:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 1,000 ms |
コード長 | 317 bytes |
コンパイル時間 | 264 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-22 21:20:30 |
合計ジャッジ時間 | 2,690 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() import math x=int(input()) def f(n): return math.factorial(n) def c(n,k): return f(n)//(f(n-k)*f(k)) if x>31: print(0,0) elif x==0: print(1,0) else: ans1=c(31,x) ans2=0 com=c(30,x-1) for i in range(31): ans2+=pow(2,i)*com print(ans1,ans2)