結果
問題 |
No.378 名声値を稼ごう
|
ユーザー |
![]() |
提出日時 | 2017-09-06 17:12:04 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 347 bytes |
コンパイル時間 | 1,053 ms |
コンパイル使用メモリ | 157,532 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 03:08:07 |
合計ジャッジ時間 | 1,433 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 |
ソースコード
#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; }