結果
| 問題 | No.1869 Doubling? |
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2022-03-11 23:36:55 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 176 ms / 2,000 ms |
| コード長 | 196 bytes |
| 記録 | |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 300,800 KB |
| 最終ジャッジ日時 | 2026-04-05 08:30:04 |
| 合計ジャッジ時間 | 4,247 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
N, M = map(int, input().split())
x = pow(2, N - 1)
if x <= M:
print(x * 2 - 1)
exit()
cnt = 0
ans = M
while M > 1:
M = -(-M//2)
ans += M
cnt += 1
ans += N - cnt - 1
print(ans)
ntuda