結果

問題 No.2534 コラッツ数列
ユーザー hiro71687khiro71687k
提出日時 2023-11-13 13:55:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 589 bytes
コンパイル時間 4,455 ms
コンパイル使用メモリ 262,280 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2023-11-13 13:55:12
合計ジャッジ時間 5,078 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 WA -
testcase_04 AC 2 ms
6,548 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
6,548 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
6,548 KB
testcase_12 AC 1 ms
6,548 KB
testcase_13 AC 2 ms
6,548 KB
testcase_14 AC 2 ms
6,548 KB
testcase_15 AC 2 ms
6,548 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
6,548 KB
testcase_20 AC 2 ms
6,548 KB
testcase_21 AC 2 ms
6,548 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 2 ms
6,548 KB
testcase_25 AC 2 ms
6,548 KB
testcase_26 AC 1 ms
6,548 KB
testcase_27 AC 2 ms
6,548 KB
testcase_28 AC 2 ms
6,548 KB
testcase_29 AC 2 ms
6,548 KB
testcase_30 WA -
testcase_31 AC 2 ms
6,548 KB
testcase_32 AC 2 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<atcoder/all>
using namespace atcoder;
using namespace std;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll mod=998244353;
ll inf=30000000000000000;//10^17
int main(){
    ll n;
    cin >> n;
    for (ll i = 0; i < 50; i++)
    {
        if (n==1)
        {
            cout << "Yes" << endl;
            cout << (i+1)*2 << endl;
            return 0;
        }
        if ((i+1)*2>=50)
        {
            cout << "No" << endl;
            return 0;
        }
        if (n%2==0)
        {
            n/=2;
        }
    }
    
}
0