結果
| 問題 |
No.642 Two Operations No.1
|
| コンテスト | |
| ユーザー |
iqueue02
|
| 提出日時 | 2020-02-20 23:36:35 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 331 bytes |
| コンパイル時間 | 1,555 ms |
| コンパイル使用メモリ | 167,024 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-08 19:24:44 |
| 合計ジャッジ時間 | 2,190 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
int main(){
int n;
cin >> n;
int res = 0;
while (1 < n) {
if (n % 2 == 1) n++, res++;
else n /= 2, res++;
}
cout << res << endl;
return 0;
}
iqueue02