結果
| 問題 | No.642 Two Operations No.1 |
| コンテスト | |
| ユーザー |
pin
|
| 提出日時 | 2018-02-03 19:45:30 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 456 bytes |
| 記録 | |
| コンパイル時間 | 768 ms |
| コンパイル使用メモリ | 102,900 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-05 00:00:53 |
| 合計ジャッジ時間 | 1,403 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include <iostream>
#include <iomanip>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <queue>
#include <functional>
#include <map>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const int INF = 10000000;
ll n;
int main(void){
cin >> n;
int ans = 0;
while (n > 1){
if (n % 2 == 1) n += 1;
else n /= 2;
ans++;
}
cout << ans << endl;
}
pin