結果

問題 No.2426 Select Plus or Minus
ユーザー taro2023
提出日時 2023-08-18 22:55:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 524 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 818,156 KB
最終ジャッジ日時 2024-11-28 09:19:20
合計ジャッジ時間 46,994 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 MLE * 1
other AC * 20 WA * 7 TLE * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**9)
a=int(input())
def c(b,result=None,i=0):
    if result is None:
        result=[]
    if b==1:
        return result,i
    else:
        if b%2==0:
            b=b/2
            result.append("/")
            i+=1
        else:
            if b!=7:
                b=3*b-1
                result.append("-")
                i+=1
            else:
                b=3*b+1
                result.append("+")
                i+=1
        return c(b,result,i)
d,e=c(a)
print(e)
print(*d)
0