結果

問題 No.2426 Select Plus or Minus
ユーザー 坂口春斗坂口春斗
提出日時 2023-08-25 20:41:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-24 06:54:11
合計ジャッジ時間 4,594 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 32 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
operation_char = ""
repeat_times = 0

while n != 1:
    if n % 2:
        n = 3*n + 1
        operation_char += "+"
    else:
        n /= 2
        operation_char += "/"
    repeat_times += 1

print(repeat_times)
print(operation_char)
0