結果
問題 | No.1869 Doubling? |
ユーザー |
|
提出日時 | 2022-08-10 15:14:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,606 ms / 2,000 ms |
コード長 | 393 bytes |
コンパイル時間 | 1,859 ms |
コンパイル使用メモリ | 193,164 KB |
最終ジャッジ日時 | 2025-01-30 20:02:20 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 43 |
ソースコード
typedef long long ll; typedef long double ld; #include <bits/stdc++.h> using namespace std; #define int long long signed main(){ ll n,m; std::cin >> n>>m; ll ans = 0; ll las; if(n>30){ las = m; }else{ las = min(m,1ll<<(n-1)); } for (int i = 0; i <n; i++) { ans += las; las = (las+1)/2; } std::cout << ans << std::endl; }