結果
問題 | No.887 Collatz |
ユーザー |
|
提出日時 | 2019-11-07 18:24:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 285 bytes |
コンパイル時間 | 334 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-15 00:42:50 |
合計ジャッジ時間 | 1,965 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
nn=int(input()) lst=[] lst.append(nn) n=400 for i in range(n): if lst[i]==1: print(i) break if lst[i]%2==0: lst.append(int(lst[i]/2)) # print(lst[i]) if lst[i]%2!=0: lst.append(int(3*lst[i]+1)) # print(lst[i]) print(max(lst))