結果

問題 No.381 名声値を稼ごう Extra
ユーザー 37zigen
提出日時 2016-06-17 23:08:35
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 496 bytes
コンパイル時間 2,228 ms
コンパイル使用メモリ 74,824 KB
実行使用メモリ 68,480 KB
最終ジャッジ日時 2024-10-09 17:00:53
合計ジャッジ時間 11,768 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().solve();
	}

	void solve() {
		Scanner sc = new Scanner(System.in);
		BigInteger N = new BigInteger(sc.next());
		BigInteger ans = N;
		long count=0;
		while(N.compareTo(BigInteger.ZERO)==1){
			if(N.mod(BigInteger.valueOf(2)).equals(BigInteger.ONE)){
				count++;
			}
			N=N.divide(BigInteger.valueOf(2));
		}
		System.out.println(count);
	}
}
0