結果

問題 No.642 Two Operations No.1
ユーザー YamaKasa
提出日時 2018-09-30 18:24:29
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 316 bytes
コンパイル時間 2,121 ms
コンパイル使用メモリ 74,004 KB
実行使用メモリ 41,436 KB
最終ジャッジ日時 2024-10-12 09:15:49
合計ジャッジ時間 4,696 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		scan.close();
		int cnt = 0;
		while(1 < N) {
			if(N%2 == 0) {
				N++;
				cnt++;
			}else {
				N /= 2;
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}
0