GVKun编程网logo

物体检测,Error: maximum box coordinate value is too large(物体检测名词解释)

12

如果您想了解物体检测,Error:maximumboxcoordinatevalueistoolarge的相关知识,那么本文是一篇不可错过的文章,我们将对物体检测名词解释进行全面详尽的解释,并且为您提

如果您想了解物体检测,Error: maximum box coordinate value is too large的相关知识,那么本文是一篇不可错过的文章,我们将对物体检测名词解释进行全面详尽的解释,并且为您提供关于2 条线图之间的阴影区域 ValueError: ordinal must be >= 1、@JoinColumnOrFormula(formula=@JoinFormula org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column、Avito Cool Challenge 2018:D. Maximum Distance、Educational Codeforces Round 59 (Rated for Div. 2)G. Vasya and Maximum Profit 区间dp的有价值的信息。

本文目录一览:

物体检测,Error: maximum box coordinate value is too large(物体检测名词解释)

物体检测,Error: maximum box coordinate value is too large(物体检测名词解释)

使用 ssd 目标检测,出现 error:maximum box coordinate value is larger than 1.100000: ] [1.325]

主要原因在于,用 labelImg 标记的目标太小,以及标记工具出现问题

1 deleted all boxes that are less than 1/16 th of the image size and the training works fine.,https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/blob/master/sizeChecker.py

if x_value < 33 or y_value < 33: 删除,shutil.move (file, tree + ''/wrong_data/'')

2. 忽视结果

Actually, I just ignore this error, change the ./core/box_list_ops.py
`max_assert = tf.Assert(tf.greater_equal(1.1, box_maximum), [''maximum box coordinate value is larger '' ''than 1.1: '', box_maximum])`
1.01 to 1.1, as my error max value is 1.014.
By this way to make the code keep on. Seems the result is not affected.

参考链接:https://github.com/tensorflow/models/issues/1754

2 条线图之间的阴影区域 ValueError: ordinal must be >= 1

2 条线图之间的阴影区域 ValueError: ordinal must be >= 1

如何解决2 条线图之间的阴影区域 ValueError: ordinal must be >= 1?

我有以下代码可以正确呈现:

plt.xlabel(''Date'')
    plt.ylabel(''Temp'')
    plt.title(''Min and Max temperature 2005-2014'')
   
    # Plotting on the first y-axis
    minimum=new_df[''min'']
    maximum=new_df[''max'']
    plt.plot(new_df[''Date''],new_df[''min''],color=''orange'',label=''Min'')
    plt.plot(new_df[''Date''],new_df[''max''],color=''olive'',label=''Max'')

enter image description here

现在我需要为两条线之间的区域着色:

我试过了:

plt.fill_between(minimum,maximum,color=''#539ecd'')

但后来我收到此错误:

ValueError                                Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self,obj)
    305                 pass
    306             else:
--> 307                 return printer(obj)
    308             # Finally look for special method names
    309             method = get_real_method(obj,self.print_method)

/opt/conda/lib/python3.6/site-packages/IPython/core/pylabtools.py in <lambda>(fig)
    225 
    226     if ''png'' in formats:
--> 227         png_formatter.for_type(figure,lambda fig: print_figure(fig,''png'',**kwargs))
    228     if ''retina'' in formats or ''png2x'' in formats:
    229         png_formatter.for_type(figure,lambda fig: retina_figure(fig,**kwargs))

/opt/conda/lib/python3.6/site-packages/IPython/core/pylabtools.py in print_figure(fig,fmt,bBox_inches,**kwargs)
    117 
    118     bytes_io = BytesIO()
--> 119     fig.canvas.print_figure(bytes_io,**kw)
    120     data = bytes_io.getvalue()
    121     if fmt == ''svg'':

/opt/conda/lib/python3.6/site-packages/matplotlib/backend_bases.py in print_figure(self,filename,dpi,facecolor,edgecolor,orientation,format,**kwargs)
   2190                     orientation=orientation,2191                     dryrun=True,-> 2192                     **kwargs)
   2193                 renderer = self.figure._cachedRenderer
   2194                 bBox_inches = self.figure.get_tightbBox(renderer)

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in print_png(self,filename_or_obj,*args,**kwargs)
    543 
    544     def print_png(self,**kwargs):
--> 545         figureCanvasAgg.draw(self)
    546         renderer = self.get_renderer()
    547         original_dpi = renderer.dpi

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in draw(self)
    462 
    463         try:
--> 464             self.figure.draw(self.renderer)
    465         finally:
    466             RendererAgg.lock.release()

/opt/conda/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist,renderer,**kwargs)
     61     def draw_wrapper(artist,**kwargs):
     62         before(artist,renderer)
---> 63         draw(artist,**kwargs)
     64         after(artist,renderer)
     65 

/opt/conda/lib/python3.6/site-packages/matplotlib/figure.py in draw(self,renderer)
   1141 
   1142             mimage._draw_list_compositing_images(
-> 1143                 renderer,self,dsu,self.suppressComposite)
   1144 
   1145             renderer.close_group(''figure'')

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer,parent,suppress_composite)
    137     if not_composite or not has_images:
    138         for zorder,a in dsu:
--> 139             a.draw(renderer)
    140     else:
    141         # Composite any adjacent images together

/opt/conda/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist,renderer)
     65 

/opt/conda/lib/python3.6/site-packages/matplotlib/axes/_base.py in draw(self,inframe)
   2407             renderer.stop_rasterizing()
   2408 
-> 2409         mimage._draw_list_compositing_images(renderer,dsu)
   2410 
   2411         renderer.close_group(''axes'')

/opt/conda/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer,renderer)
     65 

/opt/conda/lib/python3.6/site-packages/matplotlib/axis.py in draw(self,**kwargs)
   1134         renderer.open_group(__name__)
   1135 
-> 1136         ticks_to_draw = self._update_ticks(renderer)
   1137         ticklabelBoxes,ticklabelBoxes2 = self._get_tick_bBoxes(ticks_to_draw,1138                                                                 renderer)

/opt/conda/lib/python3.6/site-packages/matplotlib/axis.py in _update_ticks(self,renderer)
    967 
    968         interval = self.get_view_interval()
--> 969         tick_tups = [t for t in self.iter_ticks()]
    970         if self._smart_bounds:
    971             # handle inverted limits

/opt/conda/lib/python3.6/site-packages/matplotlib/axis.py in <listcomp>(.0)
    967 
    968         interval = self.get_view_interval()
--> 969         tick_tups = [t for t in self.iter_ticks()]
    970         if self._smart_bounds:
    971             # handle inverted limits

/opt/conda/lib/python3.6/site-packages/matplotlib/axis.py in iter_ticks(self)
    910         Iterate through all of the major and minor ticks.
    911         """
--> 912         majorLocs = self.major.locator()
    913         majorTicks = self.get_major_ticks(len(majorLocs))
    914         self.major.formatter.set_locs(majorLocs)

/opt/conda/lib/python3.6/site-packages/matplotlib/dates.py in __call__(self)
    981     def __call__(self):
    982         ''Return the locations of the ticks''
--> 983         self.refresh()
    984         return self._locator()
    985 

/opt/conda/lib/python3.6/site-packages/matplotlib/dates.py in refresh(self)
   1001     def refresh(self):
   1002         ''Refresh internal information based on current limits.''
-> 1003         dmin,dmax = self.viewlim_to_dt()
   1004         self._locator = self.get_locator(dmin,dmax)
   1005 

/opt/conda/lib/python3.6/site-packages/matplotlib/dates.py in viewlim_to_dt(self)
    758             vmin,vmax = vmax,vmin
    759 
--> 760         return num2date(vmin,self.tz),num2date(vmax,self.tz)
    761 
    762     def _get_unit(self):

/opt/conda/lib/python3.6/site-packages/matplotlib/dates.py in num2date(x,tz)
    399         tz = _get_rc_timezone()
    400     if not cbook.iterable(x):
--> 401         return _from_ordinalf(x,tz)
    402     else:
    403         x = np.asarray(x)

/opt/conda/lib/python3.6/site-packages/matplotlib/dates.py in _from_ordinalf(x,tz)
    252 
    253     ix = int(x)
--> 254     dt = datetime.datetime.fromordinal(ix).replace(tzinfo=UTC)
    255 
    256     remainder = float(x) - ix

ValueError: ordinal must be >= 1

<matplotlib.figure.figure at 0x7fb311ea1cf8>

编辑:

数据框如下所示:

Date  min  max  min2015  max2015
0   2014-01-01 -160  156     -133       11
1   2014-01-02 -267  139     -122       39
2   2014-01-03 -267  133      -67       39
3   2014-01-04 -261  106      -88       44
4   2014-01-05 -150  128     -155       28

我将日期转换为日期时间类型,如下所示:

  new_df[''Date''] =  pd.to_datetime(new_df[''Date''],infer_datetime_format=True)

编辑:

当我运行时: plt.fill_between(new_df[''Date''],最小值,最大值)

我收到此错误

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-23-0f6fcbb48fdc> in <module>()
     59 
     60 
---> 61 leaflet_plot_stations(400,''fb441e62df2d58994928907a91895ec62c2c42e6cd075c2700843b89'')

<ipython-input-23-0f6fcbb48fdc> in leaflet_plot_stations(binsize,hashid)
     44     minimum = new_df[''min'']
     45     maximum =  new_df[''max'']
---> 46     plt.fill_between(new_df[''Date''],minimum,maximum)
     47     #plt.scatter(new_df[''Date''],new_df[''min2015''],''o'')
     48     #plt.scatter(new_df[''Date''],new_df[''max2015''],''o'')

/opt/conda/lib/python3.6/site-packages/matplotlib/pyplot.py in fill_between(x,y1,y2,where,interpolate,step,hold,data,**kwargs)
   2999         ret = ax.fill_between(x,y2=y2,where=where,3000                               interpolate=interpolate,step=step,data=data,-> 3001                               **kwargs)
   3002     finally:
   3003         ax._hold = washold

/opt/conda/lib/python3.6/site-packages/matplotlib/__init__.py in inner(ax,**kwargs)
   1890                     warnings.warn(msg % (label_namer,func.__name__),1891                                   RuntimeWarning,stacklevel=2)
-> 1892             return func(ax,**kwargs)
   1893         pre_doc = inner.__doc__
   1894         if pre_doc is None:

/opt/conda/lib/python3.6/site-packages/matplotlib/axes/_axes.py in fill_between(self,x,**kwargs)
   4770 
   4771         # Convert the arrays so we can work with them
-> 4772         x = ma.masked_invalid(self.convert_xunits(x))
   4773         y1 = ma.masked_invalid(self.convert_yunits(y1))
   4774         y2 = ma.masked_invalid(self.convert_yunits(y2))

/opt/conda/lib/python3.6/site-packages/numpy/ma/core.py in masked_invalid(a,copy)
   2343         cls = type(a)
   2344     else:
-> 2345         condition = ~(np.isfinite(a))
   2346         cls = MaskedArray
   2347     result = a.view(cls)

TypeError: ufunc ''isfinite'' not supported for the input types,and the inputs Could not be safely coerced to any supported types according to the casting rule ''''safe''''

解决方法

看起来是在时间轴上水平尝试填充,minimummaximum 包含不是日期的值。我查过documentation:

matplotlib.pyplot.fill_between(x,y1,y2=0,where=None,interpolate=False,step=None,*,data=None,**kwargs)

这是第一个错误。

然后使用比 1.17.0 更新的 numpy,你可以这样做:

size = 500

minimum = np.random.normal(0,100,size)
minimum.sort()
minimum = np.random.randint(250,300,size) - np.abs(minimum)
df = pd.DataFrame(minimum,pd.date_range("2005-01-01",periods=size,freq="d"),columns=[''min''],)
df[''max''] = df[''min''] + np.random.randint(200,250,size)
fig = df.plot()
fig.fill_between(df.index,df[''min''],df[''max''],color=''#539ecd'')

但是从第二个回溯中,我们可以看到 fill_between 正在所有轴上尝试 ~(np.isfinite(a))。 Which isn''t supported on older numpy.datetime64,x 轴的类型。

因此我们将不得不使用数字 x 轴,然后更改标签。

df = pd.DataFrame(minimum,color=''#539ecd'')
# We take the original datetime axis 
date_axis = pd.date_range("2005-01-01",freq="d")
# and map a function from (axis,tick) -> wanted string
def label(axis,tick):
    tick = int(tick)
    if tick == len(axis):
        tick -= 1
    if 0 <= tick < len(axis):  
        return f"{axis[tick].year}-{axis[tick].month}"
    else:
        return '' ''

fig.set_xticks(fig.get_xticks())  #silence a warning
fig.set_xticklabels(
    [label(date_axis,tick) for tick in fig.get_xticks()]
)
,

fill_between 将 x 坐标作为第一个参数。以下应该有效:

plt.fill_between(new_df["Date"],minimum,maximum,color="lemonchiffon")

请注意,使用 matplotlib 3.4 我无法重现该错误。无论 Date 中的值是转换为日期还是保留为字符串,fill_between(minimum,maximum) 都不会引发错误,但会产生意外的图。


编辑

使用 numpy 1.11.3 和 matplotlib 2.0.2,我已经能够通过 TypeError 重现 np.isfinite 加注(有关详细信息,请参阅 this post)。实际上,此函数仅从 1.17 版开始支持 datetime64。 我强烈建议您更新 matplotlib 和 numpy 的版本。但是,使用本段中描述的早期版本,通过显式转换日期来绕过错误:

plt.fill_between(np.array(new_df["Date"]),color=''lemonchiffon'')

@JoinColumnOrFormula(formula=@JoinFormula org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column

@JoinColumnOrFormula(formula=@JoinFormula org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column

@JoinColumnOrFormula (formula=@JoinFormula 在 hibernate4.3.11 中报错:

Caused by: java.lang.ClassCastException: org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column
    at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:433)
    at org.hibernate.cfg.annotations.CollectionBinder.bindCollectionSecondPass(CollectionBinder.java:1467)
    at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:865)
    at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:780)
    at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:729)
    at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:70)
    at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1697)
    at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1426)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930)
    at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:372)
    at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:454)
    at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:439)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
    ... 75 more

M_CIF_INTERNATIONAL_CHECK

package com.hnair.opcnet.ods.ml.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Where;

import com.hnair.opcnet.common.util.DateUtils;

@Entity
@Table(name="M_CIF_INTERNATIONAL_CHECK")
public class M_CIF_INTERNATIONAL_CHECK implements java.io.Serializable {
	private static final long serialVersionUID = -1; 

	@Id 
	@GeneratedValue(strategy = GenerationType.IDENTITY) 
	@Column(name =  "ID") 
	private Long id;
	
	@Column(name =  "SRC_ID") 
	private String srcId;
	@OneToMany(fetch = FetchType.EAGER, mappedBy="check")
//	@Where(clause="DELETED = 0")
	private Set<M_CIF_INTERNATIONAL_CHECK_FILE> checkFile = new HashSet<M_CIF_INTERNATIONAL_CHECK_FILE>(); 

	public void setId(Long id){
		this.id=id;
	}
	public Long getId(){
		return id;
	}
	
	public Set<M_CIF_INTERNATIONAL_CHECK_FILE> getCheckFile() {
		return checkFile;
	}
	public void setCheckFile(Set<M_CIF_INTERNATIONAL_CHECK_FILE> checkFile) {
		this.checkFile = checkFile;
	}
}

M_CIF_INTERNATIONAL_CHECK_FILE

package com.hnair.opcnet.ods.ml.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.JoinColumnOrFormula;
import org.hibernate.annotations.JoinColumnsOrFormulas;
import org.hibernate.annotations.JoinFormula;

import com.hnair.opcnet.common.util.DateUtils;

@Entity
@Table(name="M_CIF_INTERNATIONAL_CHECK_FILE")
public class M_CIF_INTERNATIONAL_CHECK_FILE implements java.io.Serializable {
	private static final long serialVersionUID = -1; 

	@Id 
	@GeneratedValue(strategy = GenerationType.IDENTITY) 
	@Column(name =  "ID") 
	private Long id;
	 
	@Column(name =  "SRC_ID") 
	private String srcId;
	
	@ManyToOne(cascade = CascadeType.REFRESH, targetEntity = M_CIF_INTERNATIONAL_CHECK.class)
	@JoinColumnsOrFormulas(value={
			@JoinColumnOrFormula(column=@JoinColumn(name = "CHECKID", referencedColumnName = "SRC_ID", nullable = true, insertable = false, updatable = false))
			,@JoinColumnOrFormula(formula=@JoinFormula(value="0", referencedColumnName = "DELETED"))
			})
	private M_CIF_INTERNATIONAL_CHECK check;
	
	
	 /** 删除标志 */ 
	@Column(name =  "DELETED") 
	private Integer deleted;

	public void setId(Long id){
		this.id=id;
	}
	public Long getId(){
		return id;
	}
	
	 /** 设置 删除标志 */ 
	public void setDeleted(Integer deleted){
		this.deleted=deleted;
	}
	 /** 获取 删除标志 */ 
	public Integer getDeleted(){
		return deleted;
	}
	public M_CIF_INTERNATIONAL_CHECK getCheck() {
		return check;
	}
	public void setCheck(M_CIF_INTERNATIONAL_CHECK check) {
		this.check = check;
	}
}

主表 M_CIF_INTERNATIONAL_CHECK 中使用 @Where (clause="DELETED = 0")

子表 M_CIF_INTERNATIONAL_CHECK_FILE 取消,@JoinColumnOrFormula (formula=@JoinFormula (value="0", referencedColumnName = "DELETED"))

是正常的

Avito Cool Challenge 2018:D. Maximum Distance

Avito Cool Challenge 2018:D. Maximum Distance

D. Maximum Distance

题目链接:https://codeforces.com/contest/1081/problem/D

题意:

给出一个连通图以及一些特殊点,现在定义cost(u,v)为一条从u到v的路径上面边权的最大值,然后定义dis(u,v)为从u到v所有路径上面cost的最小值。

最后求所有特殊点到其它特殊点的最大距离...

 

题解:
这个题意似乎有点绕...

我们考虑一下最小生成树,那么点与点之间的距离就为最小生成树路径上面边权的最大值。

我们来证明一下:假设在最小生成树上面的路径cost为w1,另外在原图中还有一条路径从u到v,其cost为w2,那么必然有w2>w1的。那么我们最后的dis一定是w1。

那么我们现在的目标就是求特殊点到特殊点之间的最大距离。注意一下这里是从一个特殊点到其它所有特殊点的最大距离。

我们知道在Kruskal加边时,后加的边权一定时大于前面的边权的,既然要求最大权值,那么我们可以想加的最后一条边是否可以作为答案。

我们假设现在有两个集合,现在将其连接起来,当满足两个集合里面都有特殊点时我们就可以更新答案了,否则就不行。

所以我们合并的时候顺带维护一下集合里面特殊点的信息就可以了。

 

代码如下:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N =1e5+5;
struct Edge{
    int u,v,w;
    bool operator < (const Edge&A)const{
        return w<A.w;
    }
}e[N];
int n,m,k;
int a[N],f[N],val[N];
int find(int x){
    if(x==f[x]) return f[x];
    f[x]=find(f[x]);
    return f[x];
}
int main(){
    cin>>n>>m>>k;
    int tot=k;
    for(int i=1,t;i<=k;i++){
        cin>>t;
        a[t]=1;
    }
    for(int i=1;i<=m;i++){
        int u,v,w;
        scanf("%d%d%d",&u,&v,&w);
        e[i]=Edge{u,v,w};
    }
    for(int i=1;i<=n;i++) f[i]=i;
    sort(e+1,e+m+1);
    int ans;
    for(int i=1;i<=m;i++){
        int u=e[i].u,v=e[i].v,w=e[i].w;
        int fx=find(u),fy=find(v);
        if(fx==fy) continue;
        f[fx]=fy;
        if(a[u]) val[fx]++;if(a[v]) val[fy]++;
        if(val[fx]&&val[fy]) ans=w;
        val[fy]+=val[fx];
    }
    for(int i=1;i<=k;i++) cout<<ans<<" ";
    return 0;
}

 

Educational Codeforces Round 59 (Rated for Div. 2)G. Vasya and Maximum Profit 区间dp

Educational Codeforces Round 59 (Rated for Div. 2)G. Vasya and Maximum Profit 区间dp

题目链接:G. Vasya and Maximum Profit

与这道题相似

题意,给个长度为n的01字符串s,以及长度为n数组a.你每次可以选择任意长度L的连续子串(要求子串每个字符相同)从原串中去掉,并获得a【L】的值。问你可能获得的值最多是多少

题解:

dp[i][j][k]代表区间i,j后面跟k的与s[j]相同的字符。

状态转移

 第一种去掉j-1后面的k+1字符dp[l][r][k]=max(dp[l][r][k],dp[l][r-1][0]+a[k+1]);

 第二种在i,j-1的区间中找一个与s[j]相同的位置p然后去掉中间的部分[p+1,j-1]

  dp[i][j][k]=max(dp[i][j][k],dp[i][p][k+1]+dp[p+1][j-1][0]);

最后答案就是dp[0][n-1][0];

#include<bits/stdc++.h>
#define ws wewe
#define ll long long
using namespace std;
const int N=105;
ll a[N],dp[N][N][N];
int n;
string ss;
int main()
{

    scanf("%d",&n);
    cin>>ss;
    for(int i=1;i<=n;i++)scanf("%I64d",&a[i]);
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            dp[i][i][j]=a[j+1];
        }
    }
    for(int s=2;s<=n;s++)//枚举区间长度
    {
        for(int l=0;l+s-1<n;L++)//枚举区间左节点
        {
            int r=l+s-1;
            for(int k=0;k<n;k++)//枚举后面有多少个s[r]相同的字符
            {
                dp[l][r][k]=dp[l][r-1][0]+a[k+1];
                for(int j=l;j<r;j++)
                {
                    if(ss[j]==ss[r])
                    {
                         dp[l][r][k]=max(dp[l][r][k],dp[l][j][k+1]+dp[j+1][r-1][0]);
                    }

                }
            }
        }
    }
    printf("%I64d\n",dp[0][n-1][0]);

    return 0;
}

今天的关于物体检测,Error: maximum box coordinate value is too large物体检测名词解释的分享已经结束,谢谢您的关注,如果想了解更多关于2 条线图之间的阴影区域 ValueError: ordinal must be >= 1、@JoinColumnOrFormula(formula=@JoinFormula org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column、Avito Cool Challenge 2018:D. Maximum Distance、Educational Codeforces Round 59 (Rated for Div. 2)G. Vasya and Maximum Profit 区间dp的相关知识,请在本站进行查询。

本文标签: