結果
| 問題 | 
                            No.2534 コラッツ数列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-11-10 21:36:06 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 931 bytes | 
| コンパイル時間 | 3,583 ms | 
| コンパイル使用メモリ | 242,828 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-26 01:14:43 | 
| 合計ジャッジ時間 | 3,850 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 33 | 
ソースコード
#include <bits/stdc++.h>
// #include <x86intrin.h>
using namespace std;
using namespace numbers;
int main(){
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(ios::badbit | ios::failbit);
	long long n;
	cin >> n;
	for(auto i = 2, t = 2; i <= 50; ++ i){
		if(t == 2){
			if(n == 1){
				cout << "Yes\n" << i << endl;
				return 0;
			}
			t = 3;
		}
		else{
			if(n % 2 == 0){
				n = n / 2;
			}
			else{
				n = 3 * n + 1;
			}
			t = 2;
		}
	}
	cout << "No\n";
	return 0;
}
/*
*/
////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                   Coded by Aeren                                   //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////