結果
問題 |
No.887 Collatz
|
ユーザー |
![]() |
提出日時 | 2019-12-12 15:43:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 407 bytes |
コンパイル時間 | 1,568 ms |
コンパイル使用メモリ | 165,276 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-25 02:14:42 |
合計ジャッジ時間 | 2,488 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 28 |
ソースコード
#include <bits/stdc++.h> #include <iostream> #include <string> #include <vector> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<n-1;i++) typedef long long ll; int main(){ int n0; int i1=0,M=0; cin >> n0; while(n0<1){ if(n0%2==0){ n0/=2; }else{ n0 = 3*n0+1; } ++i1; M = max(n0,M); } cout << i1 << endl << M << endl; }