結果

問題 No.378 名声値を稼ごう
ユーザー tsunabittsunabit
提出日時 2019-06-02 13:56:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 406 bytes
コンパイル時間 3,211 ms
コンパイル使用メモリ 71,520 KB
実行使用メモリ 56,184 KB
最終ジャッジ日時 2023-09-14 21:05:20
合計ジャッジ時間 4,667 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,940 KB
testcase_01 AC 125 ms
55,700 KB
testcase_02 AC 123 ms
56,184 KB
testcase_03 AC 123 ms
55,484 KB
testcase_04 AC 122 ms
56,028 KB
testcase_05 AC 124 ms
55,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;

public class No378 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        long c = 0;
        for(long i = n; i > 0; i = i/2) {
        	c += i;
        }
        System.out.println(n * 2 - c);
    }
}
0