結果
| 問題 |
No.887 Collatz
|
| コンテスト | |
| ユーザー |
Liny52551272
|
| 提出日時 | 2019-11-12 12:34:41 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 242 bytes |
| コンパイル時間 | 375 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-18 21:46:13 |
| 合計ジャッジ時間 | 2,195 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 28 |
ソースコード
lst = []
S = int(input().strip())
lst.append(S)
while True:
if S % 2 == 0:
S = S / 2
else:
S = 3 * S + 1
if S in lst:
break
lst.append(S)
print('{}\n{}\n'.format(len(lst) - 1, int(max(lst))))
Liny52551272