結果
問題 | No.420 mod2漸化式 |
ユーザー |
|
提出日時 | 2022-04-21 14:42:24 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 37 ms / 1,000 ms |
コード長 | 295 bytes |
コンパイル時間 | 479 ms |
コンパイル使用メモリ | 82,780 KB |
実行使用メモリ | 53,912 KB |
最終ジャッジ日時 | 2024-06-22 18:45:08 |
合計ジャッジ時間 | 2,813 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
x = int(input()) import sys if x > 31: print(0,0) exit() if x == 0: print(1,0) exit() ans = 0 comb = 1 for i in range(x- 1): comb *= (30 - i) for i in range(x - 1): comb //= (i + 1) for i in range(31): ans += (1 << i) * comb count = comb * 31 // x print(count,ans)