結果
問題 |
No.2534 コラッツ数列
|
ユーザー |
|
提出日時 | 2023-11-10 23:14:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 433 bytes |
コンパイル時間 | 1,907 ms |
コンパイル使用メモリ | 165,532 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-26 02:14:02 |
合計ジャッジ時間 | 2,459 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 WA * 3 |
ソースコード
#include "bits/stdc++.h" using namespace std; #define int long long int32_t main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; for (int i = 0; ; ++i) { if ((i + 1) * 2 == 50) { cout << "No"; return 0; } if (n == 1) { cout << "Yes\n" << (i + 1) * 2 << '\n'; return 0; } if (n % 2) n = n * 3 + 1; else n /= 2; } }