結果
問題 |
No.2426 Select Plus or Minus
|
ユーザー |
![]() |
提出日時 | 2023-08-18 22:26:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 349,440 KB |
最終ジャッジ日時 | 2024-11-28 08:13:25 |
合計ジャッジ時間 | 65,699 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 RE * 1 |
other | AC * 8 WA * 1 RE * 32 |
ソースコード
import sys sys.setrecursionlimit(10**6) a=int(input()) global i 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!=a: 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)