結果
| 問題 | No.2426 Select Plus or Minus |
| コンテスト | |
| ユーザー |
taro2023
|
| 提出日時 | 2023-08-18 22:26:12 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 533 bytes |
| 記録 | |
| コンパイル時間 | 55 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 409,600 KB |
| 最終ジャッジ日時 | 2026-10-01 08:06:00 |
| 合計ジャッジ時間 | 6,491 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 1 TLE * 1 -- * 39 |
ソースコード
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)
taro2023