結果

問題 No.378 名声値を稼ごう
ユーザー tentententen
提出日時 2020-09-29 18:28:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 1,624 ms
コンパイル使用メモリ 70,708 KB
実行使用メモリ 56,172 KB
最終ジャッジ日時 2023-09-17 05:32:44
合計ジャッジ時間 3,027 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
56,172 KB
testcase_01 AC 108 ms
55,416 KB
testcase_02 AC 109 ms
55,676 KB
testcase_03 AC 109 ms
55,864 KB
testcase_04 AC 106 ms
55,876 KB
testcase_05 AC 106 ms
55,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long count = 0;
        while (n > 0) {
            count += n % 2;
            n /= 2;
        }
        System.out.println(count);
    }
}
0