結果

問題 No.378 名声値を稼ごう
ユーザー 115Yuuta115Yuuta
提出日時 2017-09-06 17:12:04
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 2,592 ms
コンパイル使用メモリ 143,232 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 15:06:28
合計ジャッジ時間 1,876 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define PI 4*atan(1)
#define INF 1e8

typedef long long ll;
typedef unsigned long long ull;


int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};

int main(){
  ull N;
  cin >> N;
  ull ans = 0;
  ull n = N * 2;
  while(1){
    ans += N;
    N /= 2;
    if(N == 0)break;
  }
  cout << n - ans << endl;
}
0