結果
問題 | No.887 Collatz |
ユーザー |
|
提出日時 | 2019-09-20 23:41:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 164 bytes |
コンパイル時間 | 839 ms |
コンパイル使用メモリ | 63,232 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 20:29:16 |
合計ジャッジ時間 | 1,542 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; main() { int N,M; cin>>N; M=N; int i=0; for(;N>1;i++) { M=M<N?N:M; N=N%2?3*N+1:N/2; } cout<<i<<endl<<M<<endl; }