結果

問題 No.378 名声値を稼ごう
ユーザー @abcde@abcde
提出日時 2019-02-19 23:33:14
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 1,143 ms
コンパイル使用メモリ 143,596 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-14 11:57:14
合計ジャッジ時間 1,642 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

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