結果
問題 | No.1869 Doubling? |
ユーザー |
|
提出日時 | 2022-02-05 14:43:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 23 ms / 2,000 ms |
コード長 | 230 bytes |
コンパイル時間 | 670 ms |
コンパイル使用メモリ | 67,276 KB |
最終ジャッジ日時 | 2025-01-27 20:27:56 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
#include<iostream>using namespace std;int main(){long N,X,ans=0;cin>>N>>X;if(0<(X>>min(N-1,60L))){cout<<(1L<<N)-1<<endl;return 0;}while(1<X){ans+=X,X=(X+1)/2,N--;}ans+=N;cout<<ans<<endl;}