結果

問題 No.2426 Select Plus or Minus
ユーザー noriocnorioc
提出日時 2023-08-18 22:46:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 723 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 71,592 KB
最終ジャッジ日時 2023-08-18 22:46:11
合計ジャッジ時間 7,728 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,524 KB
testcase_01 AC 78 ms
71,388 KB
testcase_02 AC 75 ms
71,440 KB
testcase_03 AC 78 ms
71,296 KB
testcase_04 AC 79 ms
71,544 KB
testcase_05 WA -
testcase_06 AC 83 ms
71,452 KB
testcase_07 AC 78 ms
71,232 KB
testcase_08 AC 79 ms
71,208 KB
testcase_09 AC 77 ms
71,232 KB
testcase_10 AC 77 ms
71,176 KB
testcase_11 AC 79 ms
71,320 KB
testcase_12 AC 77 ms
71,328 KB
testcase_13 AC 76 ms
71,180 KB
testcase_14 AC 81 ms
71,400 KB
testcase_15 AC 71 ms
71,060 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 104 ms
71,332 KB
testcase_20 AC 75 ms
71,276 KB
testcase_21 AC 80 ms
71,388 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 77 ms
71,304 KB
testcase_25 AC 78 ms
71,396 KB
testcase_26 AC 77 ms
71,280 KB
testcase_27 AC 79 ms
71,328 KB
testcase_28 AC 77 ms
71,464 KB
testcase_29 AC 82 ms
71,216 KB
testcase_30 AC 78 ms
71,292 KB
testcase_31 AC 75 ms
71,200 KB
testcase_32 AC 79 ms
71,244 KB
testcase_33 AC 77 ms
71,436 KB
testcase_34 AC 75 ms
71,404 KB
testcase_35 AC 77 ms
71,400 KB
testcase_36 AC 75 ms
71,288 KB
testcase_37 AC 76 ms
71,060 KB
testcase_38 AC 77 ms
71,264 KB
testcase_39 AC 78 ms
71,220 KB
testcase_40 AC 80 ms
71,460 KB
testcase_41 AC 79 ms
71,216 KB
testcase_42 AC 77 ms
71,172 KB
testcase_43 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

ans = []
x = N
m = 10 ** 18
while x != 1:
    if x % 2 == 0:
        ans.append('/')
        x //= 2
    elif 3 * x + 1 > m:
        ans.append('-')
        x = 3 * x - 1
    else:
        ans.append('+')
        x = 3 * x + 1

print(len(ans))
print(''.join(ans))
0