結果

問題 No.2426 Select Plus or Minus
ユーザー moharan627moharan627
提出日時 2023-08-18 21:08:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 712 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 71,876 KB
最終ジャッジ日時 2023-08-18 21:08:59
合計ジャッジ時間 8,303 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
71,648 KB
testcase_01 AC 108 ms
71,680 KB
testcase_02 AC 108 ms
71,524 KB
testcase_03 AC 92 ms
71,680 KB
testcase_04 AC 92 ms
71,780 KB
testcase_05 WA -
testcase_06 AC 90 ms
71,540 KB
testcase_07 AC 93 ms
71,684 KB
testcase_08 AC 96 ms
71,496 KB
testcase_09 AC 107 ms
71,776 KB
testcase_10 AC 95 ms
71,424 KB
testcase_11 AC 107 ms
71,476 KB
testcase_12 AC 91 ms
71,592 KB
testcase_13 AC 92 ms
71,764 KB
testcase_14 AC 92 ms
71,588 KB
testcase_15 AC 91 ms
71,672 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 92 ms
71,276 KB
testcase_20 AC 92 ms
71,504 KB
testcase_21 AC 91 ms
71,508 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 92 ms
71,564 KB
testcase_25 AC 94 ms
71,588 KB
testcase_26 AC 92 ms
71,424 KB
testcase_27 AC 92 ms
71,728 KB
testcase_28 AC 93 ms
71,276 KB
testcase_29 AC 95 ms
71,348 KB
testcase_30 AC 107 ms
71,712 KB
testcase_31 AC 106 ms
71,428 KB
testcase_32 AC 93 ms
71,684 KB
testcase_33 AC 105 ms
71,288 KB
testcase_34 AC 105 ms
71,780 KB
testcase_35 AC 93 ms
71,368 KB
testcase_36 AC 92 ms
71,780 KB
testcase_37 AC 92 ms
71,592 KB
testcase_38 AC 93 ms
71,772 KB
testcase_39 AC 99 ms
71,556 KB
testcase_40 AC 94 ms
71,636 KB
testcase_41 AC 106 ms
71,376 KB
testcase_42 AC 92 ms
71,592 KB
testcase_43 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10**9 + 7
MOD2 = 998244353
from collections import defaultdict
def ceil(A,B):
    return -(-A//B)
def solve():
    def II(): return int(sys.stdin.readline())
    def LI(): return list(map(int, sys.stdin.readline().split()))
    def LC(): return list(sys.stdin.readline().rstrip())
    def IC(): return [int(c) for c in sys.stdin.readline().rstrip()]
    def MI(): return map(int, sys.stdin.readline().split())
    N =II()
    Ans = []
    while(N!=1):
        if(N%2==0):
            N//=2
            Ans.append("/")
        else:
            N = 3*N+1
            Ans.append("+")
    print(len(Ans))
    print(*Ans,sep="")
    return
solve()
0