結果
| 問題 |
No.2241 Reach 1
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-11 15:18:30 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 659 bytes |
| コンパイル時間 | 939 ms |
| コンパイル使用メモリ | 95,320 KB |
| 最終ジャッジ日時 | 2025-02-15 09:48:09 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 22 |
ソースコード
#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 ans=0;
while(1){
if(N%2==0){
ans++;
while(N%2==0){
N/=2;
}
}else{
if(N==1){
break;
}
ans++;
N+=1;
}
}
cout<<ans<<endl;
}