結果

問題 No.2426 Select Plus or Minus
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-08-25 06:34:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 65,424 KB
実行使用メモリ 59,060 KB
最終ジャッジ日時 2023-08-25 10:13:03
合計ジャッジ時間 8,846 ms
ジャッジサーバーID
(参考情報)
judge000 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
58,588 KB
testcase_01 AC 107 ms
58,920 KB
testcase_02 AC 105 ms
59,048 KB
testcase_03 AC 105 ms
58,820 KB
testcase_04 AC 106 ms
58,812 KB
testcase_05 AC 106 ms
58,812 KB
testcase_06 AC 111 ms
58,668 KB
testcase_07 AC 108 ms
58,860 KB
testcase_08 AC 107 ms
59,044 KB
testcase_09 AC 106 ms
59,036 KB
testcase_10 AC 105 ms
58,984 KB
testcase_11 AC 107 ms
58,960 KB
testcase_12 AC 92 ms
59,052 KB
testcase_13 AC 86 ms
58,988 KB
testcase_14 AC 92 ms
58,992 KB
testcase_15 AC 90 ms
58,988 KB
testcase_16 AC 105 ms
59,056 KB
testcase_17 AC 105 ms
58,816 KB
testcase_18 AC 104 ms
59,044 KB
testcase_19 AC 106 ms
59,040 KB
testcase_20 AC 106 ms
58,960 KB
testcase_21 AC 106 ms
59,052 KB
testcase_22 AC 106 ms
58,812 KB
testcase_23 AC 106 ms
58,672 KB
testcase_24 AC 106 ms
58,580 KB
testcase_25 AC 106 ms
58,988 KB
testcase_26 AC 106 ms
58,768 KB
testcase_27 AC 105 ms
59,060 KB
testcase_28 AC 107 ms
58,732 KB
testcase_29 AC 90 ms
58,592 KB
testcase_30 AC 88 ms
58,776 KB
testcase_31 AC 93 ms
58,672 KB
testcase_32 AC 92 ms
58,716 KB
testcase_33 AC 106 ms
59,040 KB
testcase_34 AC 105 ms
58,812 KB
testcase_35 AC 109 ms
58,816 KB
testcase_36 AC 107 ms
58,984 KB
testcase_37 AC 105 ms
59,060 KB
testcase_38 AC 103 ms
58,880 KB
testcase_39 AC 106 ms
59,056 KB
testcase_40 AC 102 ms
58,768 KB
testcase_41 AC 105 ms
58,964 KB
testcase_42 AC 104 ms
58,724 KB
testcase_43 AC 110 ms
58,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

N = int(input())


X = []
while N !=1:
    if N%2==0:
        X.append('/')
        N //= 2
        continue
    
    if (3*N+1)%4==0:
        X.append('+')
        N = 3*N+1
    else:
        X.append('-')
        N = 3*N-1

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