結果

問題 No.1869 Doubling?
ユーザー elphe
提出日時 2024-11-13 17:12:08
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 587 ms
コンパイル使用メモリ 66,040 KB
最終ジャッジ日時 2025-02-25 04:05:54
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdint>

using namespace std;

int main()
{
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	uint32_t N, M;
	cin >> N >> M;

	uint64_t ans = 0;
	for (; N != 0 && M != 1; --N, M = (M + 1) >> 1)
		ans += M;

	cout << ans + N << '\n';
	return 0;
}
0