結果
| 問題 | No.887 Collatz |
| コンテスト | |
| ユーザー |
clearbook
|
| 提出日時 | 2019-10-23 18:12:34 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 96 ms / 2,000 ms |
| コード長 | 266 bytes |
| 記録 | |
| コンパイル時間 | 535 ms |
| コンパイル使用メモリ | 20,960 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-03-28 05:14:04 |
| 合計ジャッジ時間 | 4,238 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
n0 = int(input())
n = [n0]
flag = True
for i in range(400):
if n[i] == 1 and flag == True:
num = i
flag = False
break
if n[i] % 2 == 0:
n.append(n[i] // 2)
else:
n.append(3*n[i] + 1)
print(num)
print(max(n))
clearbook