結果

問題 No.2241 Reach 1
ユーザー srjywrdnprkt
提出日時 2023-04-22 06:20:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 955 ms
コンパイル使用メモリ 103,156 KB
最終ジャッジ日時 2025-02-12 12:56:45
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;
using ll = long long;

int main(){

    ll N, M;
    cin >> N;
    M = N;
    while(M % 2 == 0){
        M /= 2;
    }

    if (M == 1) cout << 1 << endl;
    else if (N % 2 == 1) cout << 2 << endl;
    else cout << 3 << endl;

    return 0;
}
0