結果
| 問題 |
No.642 Two Operations No.1
|
| コンテスト | |
| ユーザー |
noshi91
|
| 提出日時 | 2018-02-02 21:23:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 633 bytes |
| コンパイル時間 | 944 ms |
| コンパイル使用メモリ | 72,932 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-31 07:03:28 |
| 合計ジャッジ時間 | 1,275 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <climits>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;
int main(void) {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
uint32 n,c=0;
std::cin >> n;
while (n != 1) {
++c;
if (n & 1) ++n;
else n >>= 1;
}
std::cout << c << "\n";
return 0;
}
noshi91