結果
| 問題 |
No.378 名声値を稼ごう
|
| コンテスト | |
| ユーザー |
kapo
|
| 提出日時 | 2016-06-17 23:07:39 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 589 bytes |
| コンパイル時間 | 529 ms |
| コンパイル使用メモリ | 71,944 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-29 13:56:37 |
| 合計ジャッジ時間 | 965 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:25:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
25 | scanf("%lld", &N);
| ~~~~~^~~~~~~~~~~~
ソースコード
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <string>
#include <set>
#include <cmath>
#include <functional>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define pii pair<int, int>
#define ll long long
#define INF 1<<30
ll N;
ll a, b;
int main(void)
{
scanf("%lld", &N);
//printf("%lld\n",N);
a = N*2;
while(N) {
b += N;
N /= 2;
}
printf("%lld\n",a-b);
return 0;
}
kapo