結果
問題 | No.378 名声値を稼ごう |
ユーザー |
![]() |
提出日時 | 2016-06-17 22:27:07 |
言語 | C++11 (gcc 4.8.5) |
結果 |
AC
|
実行時間 | 4 ms |
コード長 | 293 Byte |
コンパイル時間 | 449 ms |
使用メモリ | 8,920 KB |
最終ジャッジ日時 | 2019-11-21 12:45:15 |
ソースコード
#include <iostream> #include <stdio.h> #include <math.h> #include <vector> #include <algorithm> using namespace std; int main(){ long long int n; cin >> n; long long int ans = 2*n; while(true){ ans -= n; n /= 2; if(n==0) break; // cout << n << endl; } cout << ans << endl; }