結果

問題 No.2241 Reach 1
ユーザー HydruHydru
提出日時 2023-03-10 22:17:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 225 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 81,696 KB
実行使用メモリ 259,028 KB
最終ジャッジ日時 2023-10-18 08:00:10
合計ジャッジ時間 5,095 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,376 KB
testcase_01 AC 38 ms
53,376 KB
testcase_02 AC 37 ms
53,376 KB
testcase_03 AC 39 ms
53,376 KB
testcase_04 AC 38 ms
53,376 KB
testcase_05 AC 38 ms
53,376 KB
testcase_06 AC 37 ms
53,376 KB
testcase_07 AC 37 ms
53,376 KB
testcase_08 AC 38 ms
53,376 KB
testcase_09 WA -
testcase_10 AC 37 ms
53,376 KB
testcase_11 AC 38 ms
53,376 KB
testcase_12 AC 37 ms
53,376 KB
testcase_13 AC 37 ms
53,376 KB
testcase_14 AC 37 ms
53,376 KB
testcase_15 AC 37 ms
53,376 KB
testcase_16 AC 37 ms
53,376 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ans=0
if n%2==0:
    while(n%2==0):
        n//=2
    ans+=1

while(n!=1):
    if n%4==1:
        n=n*(n-2)+1
    else:
        n=n*(n+2)+1
    ans+=1
    while(n%2==0):
        n//=2
    ans+=1
    
print(ans)
0