結果
問題 | No.381 名声値を稼ごう Extra |
ユーザー |
![]() |
提出日時 | 2021-04-03 00:40:45 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 346 bytes |
コンパイル時間 | 4,576 ms |
コンパイル使用メモリ | 340,868 KB |
実行使用メモリ | 14,016 KB |
最終ジャッジ日時 | 2024-06-06 09:30:37 |
合計ジャッジ時間 | 13,671 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~
ソースコード
#include<iostream> #include<algorithm> #include<boost/multiprecision/cpp_int.hpp> using namespace std; namespace mp = boost::multiprecision; main(){ mp::cpp_int x; cin >> x; mp::cpp_int ans = 0, t = 0; while (x){ t += x; if(ans < t + x) { ans = t + x; } x /= 2; } if(ans <t) {ans = t;} cout<<ans<<endl; }