結果

問題 No.887 Collatz
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-05-07 10:46:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 71,416 KB
最終ジャッジ日時 2023-09-20 19:44:45
合計ジャッジ時間 3,701 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,336 KB
testcase_01 AC 72 ms
71,168 KB
testcase_02 AC 71 ms
70,904 KB
testcase_03 AC 72 ms
71,216 KB
testcase_04 AC 72 ms
71,292 KB
testcase_05 AC 72 ms
71,120 KB
testcase_06 AC 73 ms
71,276 KB
testcase_07 AC 75 ms
71,160 KB
testcase_08 AC 74 ms
71,388 KB
testcase_09 AC 74 ms
71,344 KB
testcase_10 AC 73 ms
71,164 KB
testcase_11 AC 73 ms
71,124 KB
testcase_12 AC 73 ms
71,124 KB
testcase_13 AC 73 ms
71,416 KB
testcase_14 AC 72 ms
71,124 KB
testcase_15 AC 73 ms
71,280 KB
testcase_16 AC 72 ms
71,044 KB
testcase_17 AC 72 ms
71,056 KB
testcase_18 AC 73 ms
71,328 KB
testcase_19 AC 72 ms
71,280 KB
testcase_20 AC 77 ms
71,224 KB
testcase_21 AC 75 ms
71,056 KB
testcase_22 AC 72 ms
71,252 KB
testcase_23 AC 71 ms
71,060 KB
testcase_24 AC 74 ms
71,056 KB
testcase_25 AC 73 ms
71,328 KB
testcase_26 AC 72 ms
71,016 KB
testcase_27 AC 72 ms
71,052 KB
testcase_28 AC 71 ms
71,340 KB
testcase_29 AC 75 ms
71,132 KB
testcase_30 AC 72 ms
71,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n0 = int(input())
m = n0
first = -1
for i in range(10**6):
    if n0 == 1 and first == -1:
        first = i
        break
    if n0%2:
        n0 = n0*3+1
    else:
        n0 =  n0//2
    m = max(m,n0)
print(first)
print(m)
0