結果

問題 No.378 名声値を稼ごう
ユーザー Mcpu3Mcpu3
提出日時 2018-09-01 19:24:57
言語 Java
(openjdk 23)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 2,144 ms
コンパイル使用メモリ 80,140 KB
実行使用メモリ 53,956 KB
最終ジャッジ日時 2024-07-01 04:13:21
合計ジャッジ時間 3,780 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong(),s1=0,s2;
		sc.close();
		s2=n*2;
		do {
			s1+=n;
			n/=2;
		}while(n>0) ;
		System.out.print(Math.abs(s1-s2));
	}
}
0