結果

問題 No.378 名声値を稼ごう
ユーザー samplelpmas
提出日時 2017-01-01 17:50:23
言語 Java
(openjdk 23)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 2,021 ms
コンパイル使用メモリ 74,328 KB
実行使用メモリ 41,412 KB
最終ジャッジ日時 2024-06-29 22:12:14
合計ジャッジ時間 3,306 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        long prestige = sc.nextLong();

        long withSkill = prestige * 2;

        long withoutSkill = 0;

        while (0 < prestige) {
            withoutSkill += prestige;
            prestige /= 2;
        }

        long diff = withSkill - withoutSkill;

        System.out.println(diff);

    }

}
0