結果
問題 |
No.2241 Reach 1
|
ユーザー |
|
提出日時 | 2023-07-11 15:44:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 671 bytes |
コンパイル時間 | 902 ms |
コンパイル使用メモリ | 96,352 KB |
最終ジャッジ日時 | 2025-02-15 09:49:10 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include<iostream> #include<set> #include<algorithm> #include<vector> #include<string> #include<set> #include<map> #include<numeric> #include<queue> #include<cmath> using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair<int,int> P; typedef pair<int,P> PP; const ll MOD=998244353; const double PI=acos(-1); int main(){ int N; cin>>N; int n=N; while(n%2==0){ n/=2; } int ans=4; if(n==1){ //nが2のべき ans=1; }else{ //nが2のべきでない if(N%2==1){ ans=2; }else{ //N%2==0 ans=3; } } cout<<ans<<endl; }