結果
問題 |
No.420 mod2漸化式
|
ユーザー |
![]() |
提出日時 | 2021-01-13 00:18:18 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 348 bytes |
コンパイル時間 | 159 ms |
コンパイル使用メモリ | 81,996 KB |
実行使用メモリ | 52,876 KB |
最終ジャッジ日時 | 2024-11-21 13:45:32 |
合計ジャッジ時間 | 2,684 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 33 WA * 2 |
ソースコード
import math N = int(input()) if N >= 32 or N == 0: print(0, 0) exit() if N == 1: print(1, (1 << 31) - 1) exit() cnt = 0 for i in range(N, 32): cnt += math.comb(i-1, N-1) val = 0 for i in range(N, 32): val += pow(2, i - 1) * math.comb(i - 1, N - 1) val += (pow(2, i - 1) - 1) * math.comb(i - 2, N - 2) print(cnt, val)