結果

問題 No.378 名声値を稼ごう
ユーザー Pump0129Pump0129
提出日時 2018-03-28 01:48:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 539 bytes
コンパイル時間 2,616 ms
コンパイル使用メモリ 71,852 KB
実行使用メモリ 55,996 KB
最終ジャッジ日時 2023-09-12 17:55:44
合計ジャッジ時間 4,499 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,484 KB
testcase_01 AC 123 ms
53,600 KB
testcase_02 AC 123 ms
55,996 KB
testcase_03 AC 124 ms
55,504 KB
testcase_04 AC 123 ms
55,752 KB
testcase_05 AC 122 ms
53,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package net.ipipip0129.yukicoder.no378;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        long exp = scan.nextLong();
        long total_exp = exp;
        long max_exp = exp * 2;

        while (exp != 0) {
            total_exp += exp/2;
            exp /= 2;
        }

        System.out.println(max_exp - total_exp);
    }
}
0