結果
問題 |
No.1869 Doubling?
|
ユーザー |
👑 |
提出日時 | 2023-06-20 02:06:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 272 bytes |
コンパイル時間 | 589 ms |
コンパイル使用メモリ | 66,128 KB |
最終ジャッジ日時 | 2025-02-14 23:12:41 |
ジャッジサーバーID (参考情報) |
judge7 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include <iostream> using namespace std; int main(){ long long n,m;cin>>n>>m; long long nw = n; long long ans = 0; while(m!=1){ ans += m; m=(m+1)/2; n--; if(!n){ cout << (1<<nw)-1 << endl; return 0; } } cout << ans+n << endl; }