結果

問題 No.642 Two Operations No.1
ユーザー Mcpu3
提出日時 2018-04-15 11:29:06
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 290 bytes
コンパイル時間 1,900 ms
コンパイル使用メモリ 74,148 KB
実行使用メモリ 54,448 KB
最終ジャッジ日時 2024-06-26 22:48:41
合計ジャッジ時間 4,620 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no642{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n=stdIn.nextInt();
		int x=1;
		int i=0;
		while(x<n) {
			x=x<<1;
			i++;
		}
		while(x!=n) {
			x--;
			i++;
		}
		System.out.println(i);
	}
}
0