結果
問題 | No.887 Collatz |
ユーザー |
|
提出日時 | 2023-05-01 22:27:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 152 bytes |
コンパイル時間 | 185 ms |
コンパイル使用メモリ | 82,376 KB |
実行使用メモリ | 53,172 KB |
最終ジャッジ日時 | 2024-11-20 18:26:07 |
合計ジャッジ時間 | 2,520 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
n = int(input()) i = 0 nmax = n while n!=1: if n%2==0: n//=2 else: n=n*3+1 i+=1 nmax = max(nmax, n) print(i) print(nmax)