結果

問題 No.887 Collatz
ユーザー NagisaNagisa
提出日時 2019-09-20 21:37:36
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 200 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 75,864 KB
最終ジャッジ日時 2023-10-12 18:22:45
合計ジャッジ時間 4,193 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
75,528 KB
testcase_01 AC 80 ms
75,836 KB
testcase_02 AC 82 ms
75,540 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 82 ms
75,860 KB
testcase_06 AC 82 ms
75,784 KB
testcase_07 AC 82 ms
75,596 KB
testcase_08 AC 81 ms
75,804 KB
testcase_09 AC 82 ms
75,708 KB
testcase_10 AC 81 ms
75,672 KB
testcase_11 AC 80 ms
75,712 KB
testcase_12 AC 81 ms
75,540 KB
testcase_13 AC 79 ms
75,832 KB
testcase_14 AC 80 ms
75,700 KB
testcase_15 AC 80 ms
75,580 KB
testcase_16 AC 80 ms
75,708 KB
testcase_17 AC 83 ms
75,824 KB
testcase_18 AC 82 ms
75,780 KB
testcase_19 AC 81 ms
75,496 KB
testcase_20 AC 80 ms
75,492 KB
testcase_21 AC 81 ms
75,792 KB
testcase_22 AC 81 ms
75,776 KB
testcase_23 AC 80 ms
75,724 KB
testcase_24 AC 80 ms
75,604 KB
testcase_25 AC 81 ms
75,676 KB
testcase_26 AC 81 ms
75,712 KB
testcase_27 AC 81 ms
75,540 KB
testcase_28 AC 81 ms
75,676 KB
testcase_29 AC 81 ms
75,652 KB
testcase_30 AC 80 ms
75,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = 0
c = 1000
for k in range(1000000):
    ans = max(ans,n)
    if n == 1:
        c = min(c,k)
    if n%2 == 0:
        n //= 2
    else:
        n = 3*n + 1

print(c)
print(ans)
0