結果

問題 No.378 名声値を稼ごう
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-10 01:53:05
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 348 bytes
コンパイル時間 2,468 ms
コンパイル使用メモリ 74,412 KB
実行使用メモリ 54,344 KB
最終ジャッジ日時 2024-05-04 00:31:00
合計ジャッジ時間 3,989 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 137 ms
54,344 KB
testcase_02 AC 136 ms
54,156 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 149 ms
53,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextInt();
        long sumA = 0;
        long sumB = N;
        N=N/2;
        while(N!=0){
            sumA = sumA + N;
            N=N/2;
        }
        System.out.println(sumB-sumA);
    }
}
0