- 开源项目 Kubernetes 源码探索与部署指南
邹滢朦
开源项目Kubernetes源码探索与部署指南kubernetesThisistherepothattracksallpatchestotheOpenShiftdistributionofKubernetesonbranchescorrespondingtoOpenShiftreleases.Seehttps://github.com/openshift/kubernetes/blob/maste
- 极简之美:探索Minimal Linux Live的开源之旅
芮妍娉Keaton
极简之美:探索MinimalLinuxLive的开源之旅minimalMinimalLinuxLive(MLL)isatinyeducationalLinuxdistribution,whichisdesignedtobebuiltfromscratchbyusingacollectionofautomatedshellscripts.MinimalLinuxLiveoffersacoreenvi
- PDF和CDF
薛定谔的猫_大雪
概率论
在概率论和统计学中,PDF和CDF是两种描述随机变量分布的重要函数:ProbabilityDensityFunction(PDF):概率密度函数是用来描述连续随机变量可能取值的概率分布的函数。对于一个连续型随机变量X,其PDFf(x)定义为在某个取值x处的概率密度,即X在该值附近出现的概率密度。PDF的积分可以得到概率,即在某个区间内随机变量出现的概率。CumulativeDensityFunct
- Matlab 简单计算PDF和CDF
奔跑着的孩子
通信概念最大似然算法
CDF(cumulativedistributionfunction)叫做累积分布函数,描述一个实数随机变量X的概率分布,是概率密度函数的积分。它的最主要作用就是观测某些数值也就是随机变量的取值在那个附近出现的概率比较大,它是一个增函数.可以有效的处理一些异常值.随机变量小于或者等于某个数值的概率P(X=b(i)&a(s)<=b(i+1)n(i)=n(i)+1;s=s+1;endendendsum
- CentOS 7 上安装 NVIDIA Docker
ManchiBB
centosdockerlinux
在CentOS7上安装NVIDIADocker需要几个步骤。以下是安装NVIDIADocker的基本步骤:安装NVIDIA驱动:确保您的系统已经安装了NVIDIA驱动。如果没有,请先安装驱动。添加NVIDIADocker仓库:添加NVIDIADocker的官方仓库,以便安装最新版本的NVIDIADocker。distribution=$(./etc/os-release;echo$ID$VERSI
- 2019-11-18
轻微强迫症_7280
fiddler添加查看响应时间原文来自:https://www.jianshu.com/p/c9efa41bdd25fiddler的statistics标签可以查看但是这样查看需要点开每个链接进行查看,不是很方便,为了能够方便的查看各链接的响应时间,可以通过一下几种方法实现1、在菜单栏上面找到Rules->CustomRules在classHandlers{里面添加以下代码functionBegi
- 论文笔记—NDT-Transformer: Large-Scale 3D Point Cloud Localization using the Normal Distribution Transfor
入门打工人
笔记slam定位算法
论文笔记—NDT-Transformer:Large-Scale3DPointCloudLocalizationusingtheNormalDistributionTransformRepresentation文章摘要~~~~~~~在GPS挑战的环境中,自动驾驶对基于3D点云的地点识别有很高的要求,并且是基于激光雷达的SLAM系统的重要组成部分(即闭环检测)。本文提出了一种名为NDT-Transf
- ERROR: No matching distribution found for torch-geometri satisfies the requirement torch-geometric
zzzzz忠杰
笔记pytorchpython深度学习
试了网上的whl下载确保虚拟环境下nvcc和cuda版本一致,还不行遂找淘宝大佬,大佬换了pytorch版本python版本都不行最后根据报错出现的setup安装了pytest-runner,然后pipsearch。再pipinstalltorch-geometric的时候就成功了pipinstallpytest-runnerpipsearchtorch-geometricpipinstallto
- 解决安装依赖项时的ERROR: No matching distribution found for torch==1.10.0+cu111问题
CAI2256
python深度学习神经网络pytorch
这个错误通常是由于没有找到与你尝试安装的torch==1.10.0+cu111版本相匹配的Python包分发版本所致。在这种情况下,+cu111表示你正在安装针对CUDA11.1的Torch版本。因此,你需要确保你的环境中已经安装了CUDA11.1,并且你正在使用与之兼容的Torch版本。如果你使用的是Anaconda或Miniconda等Python环境管理工具,你可以尝试使用以下命令来安装CU
- ERROR: No matching distribution found for torch==1.12.0+cu113
YungJZ
日积月累python
原因pipinstalltorch==1.12.0+cu113用pip安装torch时,出现:ERROR:Nomatchingdistributionfoundfortorch==1.12.0+cu113好像不少用清华源的会出现这个问题解决办法pytorch官网:https://pytorch.org/get-started/previous-versions/找到所需要的版本,用conda下载即
- ERROR: No matching distribution found for torch==1.4.0 (from torchvision)
迷雾总会解
机器学习/深度学习坑pythonpytorch
错误描述今天在安装torchvision出现了一个错误:解决方案一看就知道是版本的问题对吧。torchvision版本与torch版本不匹配。只要指定好版本就行。pipinstall--no-depstorchvision==0.5.0下面是cuda版本,Torch版本,Torchvision版本以及python版本的对应关系做了一个表,仅供大家参考
- 解决问题:ERROR: No matching distribution found for torch==1.12.1+cu102
失合
python深度学习pytorch
conda虚拟环境安装pytorch10.2时出现报错:ERROR:Couldnotfindaversionthatsatisfiestherequirementtorch==1.12.1+cu102(fromversions:1.7.0,1.7.1,1.8.0,1.8.1,1.9.0,1.9.1,1.10.0,1.10.1,1.10.2,1.11.0,1.12.0,1.12.1,1.13.0,1
- 环境配置(五)——Linux下 anaconda 安装与python环境配置
微知girl
#环境配置pythonanacondalinux环境配置镜像
部分内容可参见环境配置(一)——python虚拟环境迁移方法环境配置(四)——Miniconda使用教程第一步anaconda安装参考https://blog.csdn.net/qq_34288630/article/details/883521011.下载anacondahttps://www.anaconda.com/distribution/选择相应的版本(我下载的是Anaconda3-20
- 读书笔记:《深入理解Java虚拟机》(8)
Violet永存
读书笔记java开发语言jvm
虚拟机性能监控、故障处理工具JDK命令行工具这些命令在JDK安装目录下的bin目录下:jps(JVMProcessStatus):类似UNIX的ps命令。用于查看所有Java进程的启动类、传入参数和Java虚拟机参数等信息;jstat(JVMStatisticsMonitoringTool):用于收集HotSpot虚拟机各方面的运行数据;jinfo(ConfigurationInfoforJava
- 【分布式注册中心】NACOS_2.3.0部署与实战
布熬夜了
后端开发分布式javaspringboot
部署一准备1依赖:MYSQL2创建数据库CREATEdatabaseifNOTEXISTS`nacos`defaultcharactersetutf8mb4collateutf8mb4_unicode_ci;3导入初始化SQLhttps://raw.githubusercontent.com/alibaba/nacos/develop/distribution/conf/mysql-schema.
- 【JupyterLab】pip安装过程问题记录(未完)
iku!!
pipJupyterLab
1、使用以下命令安装报错pipinstalljupyterlabERROR:Couldnotfindaversionthatsatisfiestherequirementjupyterlab(fromversions:none)ERROR:Nomatchingdistributionfoundforjupyterlab2、修改运行命令仍然出现报错pipinstalljupyterlab-ihttp
- ValueError: Expected parameter scale (Tensor of shape (2854529,)) of distribution Normal(loc: torch.
zhangfeng1133
pytorch深度学习人工智能
正态分布,尺度需要大于0,解决办法scale=F.softplus(scale)Traceback(mostrecentcalllast):Theaboveexceptionwasthedirectcauseofthefollowingexception:Traceback(mostrecentcalllast):File"/home/aistudio/bnn_pyro_fso_middle_2_
- ERROR: No matching distribution found for distutils 解决办法
gs80140
python
pipinstalldistutils-ihttps://pypi.doubanio.com/simpleLookinginindexes:https://pypi.doubanio.com/simpleERROR:Couldnotfindaversionthatsatisfiestherequirementdistutils(fromversions:none)ERROR:Nomatchingd
- 高斯分布推导
章靓
概率论
GaussianDistribution基础概念:似然性:用于在已知某些观测所得到的结果时,对有关事物之性质的参数进行估值。最大似然估计:给定一个概率分布DDD,一直其概率密度函数为fDf_DfD,以及一个分布参数θ\thetaθ,我们可以从这个分布中抽出一个具有nnn个值的采样X1,X2,⋯ ,XnX_1,X_2,\cdots,X_nX1,X2,⋯,Xn,利用fDf_DfD计算出其似然函数:L(
- 一维/二维高斯分布的负对数似然推导
lainegates
人工智能概率论
参考wikipediaMultivariatenormaldistribution及Normaldistribution基础公式多元高斯分布公式f(X)=f(x1,x2,...,xk)=1(2π)k∣∑∣e−12(X−μ)T∑−1(X−μ)f(X)=f(x_1,x_2,...,x_k)=\frac{1}{\sqrt{{(2\pi)}^k|\sum|}}e^{-\frac{1}{2}(X-\mu)^
- 如何检查端口占用:netstat和lsof指令
Mark White
服务器运维
在网络故障排查和系统管理中,检查端口占用情况是一项常见且重要的任务。本文将详细介绍如何使用netstat和lsof这两个强大的工具来检查端口占用和相关服务。1.使用netstat查看端口占用netstat(networkstatistics)是一个用于显示网络连接、路由表、接口统计等信息的命令行工具。1.1最常用的netstat命令netstat-an这是最常用的形式,让我们解析其参数:-a:显示
- 无线通信 - 三、四地址(Addressing Mechanism)
hiuiwb
现代通信网络三四地址无线通信
概述:IEEE802.11指定了四种地址机制,由MAC帧头部FrameControl下的flag字段前两bit决定。第一个bit指示toDS(distributionsystem),第二个bit指示fromDS。每个bit可以为0或1,所以总共可以构造出四种情况。(如下图中红色圈住的部分,最后一个bit指代上述第一个bit,倒数第二个bit指代上述第二个bit。)四种机制对应的地址:ToDSFro
- 使用python -m pip install -r requirements.txt安装yolov5出现问题
小白yaa
Python问题pythonpipYOLO
出现问题:ERROR:Couldnotfindaversionthatsatisfiestherequirementmatplotlib>=3.3(fromversions:none)ERROR:Nomatchingdistributionfoundformatplotlib>=3.3原因分析:我打开了代理服务器,这时我们使用的清华镜像源就不能使用了解决办法:关闭代理服务器即可。
- 如何查看Squid的DNS缓存
pcj_888
squidsquid
使用squidclientmgr:ipcache命令查看Squid的DNS缓存记录如果squid端口不是3128,需要指定端口号,squidclient-p{port}mgr:ipcache#squidclientmgr:ipcache...IPCacheStatistics:...IPCacheContents:HostnameFlglstrefTTLN(b)www.trendmicro.com
- Baumer工业相机堡盟工业相机如何通过BGAPI SDK获取相机的Buffer图像Statistics传输统计信息(C#)
格林威
工业相机数码相机c#开发语言计算机视觉人工智能
Baumer工业相机堡盟工业相机如何通过BGAPISDK获取相机的Buffer图像Statistics传输统计信息(C#)Baumer工业相机Baumer工业相机BGAPISDK和相机Statistics图像传输统计信息的技术背景CameraExplorer软件如何查看图像Buffer信息StatisticsBaumer工业相机通过BGAPISDK获取相机的Statistics图像传输统计信息技术
- [1271]pip报错:WARNING: Ignoring invalid distribution -ip
周小董
异常问题pip
错误:WARNING:Ignoringinvaliddistribution-ip原因可能是之前下载库的时候没有成功或者中途退出。解决方法:到提示的目录site-packages(比如我的目录是:C:\Python37\Lib\site-packages)下删除~ip开头的目录即可。错误:Lookinginindexes:https://pypi.tuna.tsinghua.edu.cn/simp
- 解决pip install时出现WARNING: Ignoring invalid distribution的警告
白白白飘
pippython人工智能
在使用pip进行Python包管理时,有时会遇到WARNING:Ignoringinvaliddistribution的警告。这个警告的出现通常意味着pip在尝试安装一个无效或不完整的包时被忽视。为了解决这个问题,我们需要先了解为什么会出现这种警告,然后采取适当的措施来解决它。出现WARNING:Ignoringinvaliddistribution的原因这种警告的出现通常是因为以下几种情况:之前
- Python 的一个警告:WARNING: Ignoring invalid distribution -andas (d:\python3.10\lib\site-packages)
流星不逝
python开发语言
一、问题:每次pip新插件的时候老出现标题所示的警告(WARNING:Ignoringinvaliddistribution-andas(d:\python3.10\lib\site-packages),是警告而非错误,本介绍主要针对强迫症,去不去掉不影响功能,但是每次提示实在是讨厌。二、问题产生原因:是因为之前安装插件失败或者中途退出导致插件安装出现异常所致。三、解决掉WARNING:根据警告信
- 【Python】已解决:WARNING: Ignoring invalid distribution -addlepaddle (d:\soft\python36\lib\site-packages)
屿小夏
python开发语言
文章目录一、分析问题背景二、可能出错的原因三、错误代码示例四、正确解决方法五、注意事项已解决:WARNING:Ignoringinvaliddistribution-addlepaddle(d:\soft\python36\lib\site-packages)一、分析问题背景在使用Python进行开发时,有时我们在执行pip命令(如piplist或pipfreeze)查看已安装的Python包时,
- 第二单元复盘
地科7宋世浩
Part11,从本单元中我学到的最重要的理念(精读和视听说分别总结)精读:美国的安全问题有很大影响,每个家庭都用安全设备来保护自己家财产视听说:每个人每天的情绪和状态都很不一样,做好一件事就很好了2,我在本片文章/音频/视频中学到的怦然心动的单词(精读和视听说分别总结)精读:latch.rural.vulnerable易受攻击的;无防御的.urban.statistics.allegedly.tr
- JAVA基础
灵静志远
位运算加载Date字符串池覆盖
一、类的初始化顺序
1 (静态变量,静态代码块)-->(变量,初始化块)--> 构造器
同一括号里的,根据它们在程序中的顺序来决定。上面所述是同一类中。如果是继承的情况,那就在父类到子类交替初始化。
二、String
1 String a = "abc";
JAVA虚拟机首先在字符串池中查找是否已经存在了值为"abc"的对象,根
- keepalived实现redis主从高可用
bylijinnan
redis
方案说明
两台机器(称为A和B),以统一的VIP对外提供服务
1.正常情况下,A和B都启动,B会把A的数据同步过来(B is slave of A)
2.当A挂了后,VIP漂移到B;B的keepalived 通知redis 执行:slaveof no one,由B提供服务
3.当A起来后,VIP不切换,仍在B上面;而A的keepalived 通知redis 执行slaveof B,开始
- java文件操作大全
0624chenhong
java
最近在博客园看到一篇比较全面的文件操作文章,转过来留着。
http://www.cnblogs.com/zhuocheng/archive/2011/12/12/2285290.html
转自http://blog.sina.com.cn/s/blog_4a9f789a0100ik3p.html
一.获得控制台用户输入的信息
&nbs
- android学习任务
不懂事的小屁孩
工作
任务
完成情况 搞清楚带箭头的pupupwindows和不带的使用 已完成 熟练使用pupupwindows和alertdialog,并搞清楚两者的区别 已完成 熟练使用android的线程handler,并敲示例代码 进行中 了解游戏2048的流程,并完成其代码工作 进行中-差几个actionbar 研究一下android的动画效果,写一个实例 已完成 复习fragem
- zoom.js
换个号韩国红果果
oom
它的基于bootstrap 的
https://raw.github.com/twbs/bootstrap/master/js/transition.js transition.js模块引用顺序
<link rel="stylesheet" href="style/zoom.css">
<script src=&q
- 详解Oracle云操作系统Solaris 11.2
蓝儿唯美
Solaris
当Oracle发布Solaris 11时,它将自己的操作系统称为第一个面向云的操作系统。Oracle在发布Solaris 11.2时继续它以云为中心的基调。但是,这些说法没有告诉我们为什么Solaris是配得上云的。幸好,我们不需要等太久。Solaris11.2有4个重要的技术可以在一个有效的云实现中发挥重要作用:OpenStack、内核域、统一存档(UA)和弹性虚拟交换(EVS)。
- spring学习——springmvc(一)
a-john
springMVC
Spring MVC基于模型-视图-控制器(Model-View-Controller,MVC)实现,能够帮助我们构建像Spring框架那样灵活和松耦合的Web应用程序。
1,跟踪Spring MVC的请求
请求的第一站是Spring的DispatcherServlet。与大多数基于Java的Web框架一样,Spring MVC所有的请求都会通过一个前端控制器Servlet。前
- hdu4342 History repeat itself-------多校联合五
aijuans
数论
水题就不多说什么了。
#include<iostream>#include<cstdlib>#include<stdio.h>#define ll __int64using namespace std;int main(){ int t; ll n; scanf("%d",&t); while(t--)
- EJB和javabean的区别
asia007
beanejb
EJB不是一般的JavaBean,EJB是企业级JavaBean,EJB一共分为3种,实体Bean,消息Bean,会话Bean,书写EJB是需要遵循一定的规范的,具体规范你可以参考相关的资料.另外,要运行EJB,你需要相应的EJB容器,比如Weblogic,Jboss等,而JavaBean不需要,只需要安装Tomcat就可以了
1.EJB用于服务端应用开发, 而JavaBeans
- Struts的action和Result总结
百合不是茶
strutsAction配置Result配置
一:Action的配置详解:
下面是一个Struts中一个空的Struts.xml的配置文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
&quo
- 如何带好自已的团队
bijian1013
项目管理团队管理团队
在网上看到博客"
怎么才能让团队成员好好干活"的评论,觉得写的比较好。 原文如下: 我做团队管理有几年了吧,我和你分享一下我认为带好团队的几点:
1.诚信
对团队内成员,无论是技术研究、交流、问题探讨,要尽可能的保持一种诚信的态度,用心去做好,你的团队会感觉得到。 2.努力提
- Java代码混淆工具
sunjing
ProGuard
Open Source Obfuscators
ProGuard
http://java-source.net/open-source/obfuscators/proguardProGuard is a free Java class file shrinker and obfuscator. It can detect and remove unused classes, fields, m
- 【Redis三】基于Redis sentinel的自动failover主从复制
bit1129
redis
在第二篇中使用2.8.17搭建了主从复制,但是它存在Master单点问题,为了解决这个问题,Redis从2.6开始引入sentinel,用于监控和管理Redis的主从复制环境,进行自动failover,即Master挂了后,sentinel自动从从服务器选出一个Master使主从复制集群仍然可以工作,如果Master醒来再次加入集群,只能以从服务器的形式工作。
什么是Sentine
- 使用代理实现Hibernate Dao层自动事务
白糖_
DAOspringAOP框架Hibernate
都说spring利用AOP实现自动事务处理机制非常好,但在只有hibernate这个框架情况下,我们开启session、管理事务就往往很麻烦。
public void save(Object obj){
Session session = this.getSession();
Transaction tran = session.beginTransaction();
try
- maven3实战读书笔记
braveCS
maven3
Maven简介
是什么?
Is a software project management and comprehension tool.项目管理工具
是基于POM概念(工程对象模型)
[设计重复、编码重复、文档重复、构建重复,maven最大化消除了构建的重复]
[与XP:简单、交流与反馈;测试驱动开发、十分钟构建、持续集成、富有信息的工作区]
功能:
- 编程之美-子数组的最大乘积
bylijinnan
编程之美
public class MaxProduct {
/**
* 编程之美 子数组的最大乘积
* 题目: 给定一个长度为N的整数数组,只允许使用乘法,不能用除法,计算任意N-1个数的组合中乘积中最大的一组,并写出算法的时间复杂度。
* 以下程序对应书上两种方法,求得“乘积中最大的一组”的乘积——都是有溢出的可能的。
* 但按题目的意思,是要求得这个子数组,而不
- 读书笔记-2
chengxuyuancsdn
读书笔记
1、反射
2、oracle年-月-日 时-分-秒
3、oracle创建有参、无参函数
4、oracle行转列
5、Struts2拦截器
6、Filter过滤器(web.xml)
1、反射
(1)检查类的结构
在java.lang.reflect包里有3个类Field,Method,Constructor分别用于描述类的域、方法和构造器。
2、oracle年月日时分秒
s
- [求学与房地产]慎重选择IT培训学校
comsci
it
关于培训学校的教学和教师的问题,我们就不讨论了,我主要关心的是这个问题
培训学校的教学楼和宿舍的环境和稳定性问题
我们大家都知道,房子是一个比较昂贵的东西,特别是那种能够当教室的房子...
&nb
- RMAN配置中通道(CHANNEL)相关参数 PARALLELISM 、FILESPERSET的关系
daizj
oraclermanfilespersetPARALLELISM
RMAN配置中通道(CHANNEL)相关参数 PARALLELISM 、FILESPERSET的关系 转
PARALLELISM ---
我们还可以通过parallelism参数来指定同时"自动"创建多少个通道:
RMAN > configure device type disk parallelism 3 ;
表示启动三个通道,可以加快备份恢复的速度。
- 简单排序:冒泡排序
dieslrae
冒泡排序
public void bubbleSort(int[] array){
for(int i=1;i<array.length;i++){
for(int k=0;k<array.length-i;k++){
if(array[k] > array[k+1]){
- 初二上学期难记单词三
dcj3sjt126com
sciet
concert 音乐会
tonight 今晚
famous 有名的;著名的
song 歌曲
thousand 千
accident 事故;灾难
careless 粗心的,大意的
break 折断;断裂;破碎
heart 心(脏)
happen 偶尔发生,碰巧
tourist 旅游者;观光者
science (自然)科学
marry 结婚
subject 题目;
- I.安装Memcahce 1. 安装依赖包libevent Memcache需要安装libevent,所以安装前可能需要执行 Shell代码 收藏代码
dcj3sjt126com
redis
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
前面3步应该没有问题,主要的问题是执行make的时候,出现了异常。
异常一:
make[2]: cc: Command not found
异常原因:没有安装g
- 并发容器
shuizhaosi888
并发容器
通过并发容器来改善同步容器的性能,同步容器将所有对容器状态的访问都串行化,来实现线程安全,这种方式严重降低并发性,当多个线程访问时,吞吐量严重降低。
并发容器ConcurrentHashMap
替代同步基于散列的Map,通过Lock控制。
&nb
- Spring Security(12)——Remember-Me功能
234390216
Spring SecurityRemember Me记住我
Remember-Me功能
目录
1.1 概述
1.2 基于简单加密token的方法
1.3 基于持久化token的方法
1.4 Remember-Me相关接口和实现
- 位运算
焦志广
位运算
一、位运算符C语言提供了六种位运算符:
& 按位与
| 按位或
^ 按位异或
~ 取反
<< 左移
>> 右移
1. 按位与运算 按位与运算符"&"是双目运算符。其功能是参与运算的两数各对应的二进位相与。只有对应的两个二进位均为1时,结果位才为1 ,否则为0。参与运算的数以补码方式出现。
例如:9&am
- nodejs 数据库连接 mongodb mysql
liguangsong
mongodbmysqlnode数据库连接
1.mysql 连接
package.json中dependencies加入
"mysql":"~2.7.0"
执行 npm install
在config 下创建文件 database.js
- java动态编译
olive6615
javaHotSpotjvm动态编译
在HotSpot虚拟机中,有两个技术是至关重要的,即动态编译(Dynamic compilation)和Profiling。
HotSpot是如何动态编译Javad的bytecode呢?Java bytecode是以解释方式被load到虚拟机的。HotSpot里有一个运行监视器,即Profile Monitor,专门监视
- Storm0.9.5的集群部署配置优化
roadrunners
优化storm.yaml
nimbus结点配置(storm.yaml)信息:
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional inf
- 101个MySQL 的调节和优化的提示
tomcat_oracle
mysql
1. 拥有足够的物理内存来把整个InnoDB文件加载到内存中——在内存中访问文件时的速度要比在硬盘中访问时快的多。 2. 不惜一切代价避免使用Swap交换分区 – 交换时是从硬盘读取的,它的速度很慢。 3. 使用电池供电的RAM(注:RAM即随机存储器)。 4. 使用高级的RAID(注:Redundant Arrays of Inexpensive Disks,即磁盘阵列
- zoj 3829 Known Notation(贪心)
阿尔萨斯
ZOJ
题目链接:zoj 3829 Known Notation
题目大意:给定一个不完整的后缀表达式,要求有2种不同操作,用尽量少的操作使得表达式完整。
解题思路:贪心,数字的个数要要保证比∗的个数多1,不够的话优先补在开头是最优的。然后遍历一遍字符串,碰到数字+1,碰到∗-1,保证数字的个数大于等1,如果不够减的话,可以和最后面的一个数字交换位置(用栈维护十分方便),因为添加和交换代价都是1