結果

問題 No.378 名声値を稼ごう
ユーザー @abcde
提出日時 2019-02-19 23:33:14
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 1,209 ms
コンパイル使用メモリ 157,520 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 19:23:38
合計ジャッジ時間 1,663 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    
    // 1. 入力情報取得.
    LL N;
    cin >> N;
    
    // 2. 名声値の余分の最大値は?
    // 2-1. スキルを持っているキャラクターを使った場合.
    // -> スキルを初回使った場合に集約される.
    LL skill = N * 2;

    // 2-2. 通常の名声値の合計.
    LL normal = N;
    while(N /= 2) normal += N;
    
    // 3. 出力.
    LL ans = skill - normal;
    cout << ans << endl;
    return 0;
    
}
0