結果
問題 | No.378 名声値を稼ごう |
ユーザー |
|
提出日時 | 2018-06-26 22:36:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 270 bytes |
コンパイル時間 | 582 ms |
コンパイル使用メモリ | 66,472 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 22:58:59 |
合計ジャッジ時間 | 1,067 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 |
ソースコード
#include <iostream> #include <vector> using namespace std; typedef long long LL; int main(int argc, char* argv[]) { LL N; cin>>N; LL x1=N*2; LL x2=N; N/=2; while (N>0){ x2+=N; N/=2; } LL ans=x2-x1; if (ans<0){ ans=-ans; } cout<<ans<<endl; return 0; }