結果
問題 |
No.2534 コラッツ数列
|
ユーザー |
|
提出日時 | 2023-11-10 23:16:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 403 bytes |
コンパイル時間 | 586 ms |
コンパイル使用メモリ | 63,128 KB |
実行使用メモリ | 16,960 KB |
最終ジャッジ日時 | 2024-09-26 02:15:49 |
合計ジャッジ時間 | 7,047 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 32 |
ソースコード
#include "iostream" using namespace std; #define int long long int32_t main() { int n; cin >> n; for (int i = 0, c = 0; ; ++i) { if (c + 1 == 50) { cout << "No"; return 0; } if (n == 1) { cout << "Yes\n" << c + 2 << '\n'; return 0; } c += 2; if (n % 2) n = n * 3 + 1; else n /= 2; } }