結果
問題 | No.420 mod2漸化式 |
ユーザー |
![]() |
提出日時 | 2021-01-13 00:20:56 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 44 ms / 1,000 ms |
コード長 | 377 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 82,464 KB |
実行使用メモリ | 52,608 KB |
最終ジャッジ日時 | 2024-11-21 13:47:27 |
合計ジャッジ時間 | 2,619 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
import mathN = int(input())if N >= 32:print(0, 0)exit()if N == 0:print(1, 0)exit()if N == 1:print(31, (1 << 31) - 1)exit()cnt = 0for i in range(N, 32):cnt += math.comb(i-1, N-1)val = 0for 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)