結果
問題 |
No.887 Collatz
|
ユーザー |
![]() |
提出日時 | 2019-09-20 21:27:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 236 bytes |
コンパイル時間 | 183 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 52,096 KB |
最終ジャッジ日時 | 2024-09-14 16:18:54 |
合計ジャッジ時間 | 2,414 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 WA * 1 |
ソースコード
n = int(input()) ans = 0 c = 0 if n == 1: print(0) print(4) exit(0) while True: ans = max(ans,n) c += 1 if n%2 == 0: n //= 2 else: n = 3*n + 1 if n == 1: break print(c) print(ans)