結果

問題 No.887 Collatz
ユーザー tter4tter4
提出日時 2019-09-20 22:08:59
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 229 bytes
コンパイル時間 1,147 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 71,444 KB
最終ジャッジ日時 2023-10-12 19:28:01
合計ジャッジ時間 3,877 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,288 KB
testcase_01 AC 74 ms
71,296 KB
testcase_02 AC 74 ms
71,408 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 74 ms
71,004 KB
testcase_06 AC 73 ms
71,052 KB
testcase_07 AC 72 ms
71,364 KB
testcase_08 AC 74 ms
71,204 KB
testcase_09 AC 71 ms
71,368 KB
testcase_10 AC 72 ms
71,204 KB
testcase_11 AC 75 ms
71,352 KB
testcase_12 AC 73 ms
71,204 KB
testcase_13 AC 73 ms
71,444 KB
testcase_14 AC 72 ms
71,160 KB
testcase_15 AC 72 ms
71,416 KB
testcase_16 AC 72 ms
71,216 KB
testcase_17 AC 71 ms
71,256 KB
testcase_18 AC 71 ms
71,376 KB
testcase_19 AC 74 ms
71,376 KB
testcase_20 AC 73 ms
71,060 KB
testcase_21 AC 73 ms
71,292 KB
testcase_22 AC 74 ms
71,400 KB
testcase_23 AC 73 ms
71,244 KB
testcase_24 AC 75 ms
71,244 KB
testcase_25 AC 75 ms
71,356 KB
testcase_26 AC 74 ms
71,060 KB
testcase_27 AC 73 ms
71,372 KB
testcase_28 AC 73 ms
71,144 KB
testcase_29 AC 73 ms
71,380 KB
testcase_30 AC 77 ms
71,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

flag = True
li = [n]
i = 0
while flag:
    if li[i] == 1:
        print(i)
        flag = False
    if li[i] % 2 == 0:
        li.append(li[i]//2)
    else:
        li.append(3*li[i]+1)
    i += 1
print(max(li))
0