結果
| 問題 |
No.378 名声値を稼ごう
|
| コンテスト | |
| ユーザー |
tenkyu9
|
| 提出日時 | 2018-03-18 06:28:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 375 bytes |
| コンパイル時間 | 616 ms |
| コンパイル使用メモリ | 81,400 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-30 04:51:45 |
| 合計ジャッジ時間 | 1,034 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<climits>
using namespace std;
typedef long long int ll;
int main(){
ll n, total1=0, total2=0;
cin >> n;
total2+=2*n;
while(n){
total1+=n;
n/=2;
}
cout << abs(total1-total2) << endl;
return 0;
}
tenkyu9