結果
問題 | No.887 Collatz |
ユーザー |
![]() |
提出日時 | 2019-12-06 09:45:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 408 bytes |
コンパイル時間 | 328 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-23 05:02:19 |
合計ジャッジ時間 | 2,274 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
n0 = int(input()) list = [] list.append(n0) i1 = 0 # limit = 0 if n0 != 1: while True: cur = list[-1] if cur % 2 == 0: list.append(cur / 2) else: list.append(3 * cur + 1) if list[-1] == 1: i1 = len(list) - 1 break # limit += 1 # if limit > 500: # break print(i1) print(int(max(list)))