結果

問題 No.642 Two Operations No.1
ユーザー yuma220284
提出日時 2020-05-29 16:06:01
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 202 bytes
コンパイル時間 2,275 ms
コンパイル使用メモリ 157,168 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-15 12:53:01
合計ジャッジ時間 3,156 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

int main() {
	int N;
	cin >> N;
	for (int i = 1; ; i++) {
		if (N % 2 == 0) N /= 2;
		else N++;
		if (N == 1) {
			cout << i << endl;
			return 0;
		}
	}
}
0