結果
| 問題 |
No.887 Collatz
|
| コンテスト | |
| ユーザー |
cureskol
|
| 提出日時 | 2020-03-18 14:45:12 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 221 bytes |
| コンパイル時間 | 1,534 ms |
| コンパイル使用メモリ | 167,096 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-14 01:54:46 |
| 合計ジャッジ時間 | 2,485 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 28 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
signed main(){
int n;cin>>n;
int mx=n,cnt=0;
while(n!=1){
if(n&1)n=n*3+1;
else n>>=1;
mx=max(mx,n);cnt++;
}
cout<<mx<<cnt<<endl;
}
cureskol