結果
問題 | No.420 mod2漸化式 |
ユーザー |
![]() |
提出日時 | 2023-01-05 20:28:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 38 ms / 1,000 ms |
コード長 | 290 bytes |
コンパイル時間 | 138 ms |
コンパイル使用メモリ | 82,036 KB |
実行使用メモリ | 51,968 KB |
最終ジャッジ日時 | 2024-11-29 11:54:37 |
合計ジャッジ時間 | 2,233 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
def naive_comb(N, K): if K < 0: return 0 ans = 1 K = min(K, N - K) for i in range(K): ans *= N - i ans //= i + 1 return ans x = int(input()) if x >= 32: print(0, 0) exit() print(naive_comb(31, x), naive_comb(30, x - 1) * (pow(2, 31)-1))