当前位置: 首页 > news >正文

彩票网站的客服有做吗企业网站优化的三层含义

彩票网站的客服有做吗,企业网站优化的三层含义,魔方的网站,做养生网站需要资质吗任务安排I: 有 N 个任务排成一个序列在一台机器上等待执行,它们的顺序不得改变。 机器会把这 N 个任务分成若干批,每一批包含连续的若干个任务。 从时刻 0 开始,任务被分批加工,执行第 i 个任务所需的时间是 Ti。 另外&#x…

任务安排I:

有 N 个任务排成一个序列在一台机器上等待执行,它们的顺序不得改变。

机器会把这 N 个任务分成若干批,每一批包含连续的若干个任务。

从时刻 0 开始,任务被分批加工,执行第 i 个任务所需的时间是 Ti。

另外,在每批任务开始前,机器需要 S 的启动时间,故执行一批任务所需的时间是启动时间 S 加上每个任务所需时间之和。

一个任务执行后,将在机器中稍作等待,直至该批任务全部执行完毕。

也就是说,同一批任务将在同一时刻完成。

每个任务的费用是它的完成时刻乘以一个费用系数 Ci。

请为机器规划一个分组方案,使得总费用最小。

输入格式

第一行包含整数 N。

第二行包含整数 S。

接下来 N 行每行有一对整数,分别为 Ti 和 Ci,表示第 i 个任务单独完成所需的时间 Ti 及其费用系数 Ci。

输出格式

输出一个整数,表示最小总费用。

数据范围

1≤N≤5000,
0≤S≤50,
1≤Ti,Ci≤100

输入样例:

5
1
1 3
3 2
4 3
2 3
1 4

输出样例:

153
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
const int N = 5010;
ll sumt[N],sumc[N],f[N];
//sumt[N]时间前缀和
//sumc[N]费用前缀和
//f[N]是将前i个任务处理完的所有方案的集合
ll n,s;int main()
{cin>>n>>s;for(int i=1;i<=n;i++){int t,c;cin>>t>>c;sumt[i] = t + sumt[i-1];sumc[i] = c + sumc[i-1];}memset(f,0x3f,sizeof f);//预防下面求最小值出错,先初始化为无穷大f[0] = 0;//前0个任务处理完的方案数自然为0for(int i=1;i<=n;i++){for(int j=0;j<i;j++){f[i] = min(f[i],f[j]+sumt[i]*(sumc[i]-sumc[j])+s*(sumc[n]-sumc[j]));}}cout<<f[n]<<endl;return 0;
}

 

 AcWing 300. 任务安排1【线性DP+费用提前计算思想】 - AcWing

 任务安排II:斜率优化DP

#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;typedef long long ll;
const int N = 300010;
int n,s;
ll c[N],t[N],f[N],q[N];int main()
{cin>>n>>s;//读入数据计算时间和代价的前缀和for(int i=1;i<=n;i++){int a,b;cin>>a>>b;c[i] = c[i-1]+b;t[i] = t[i-1]+a;}int hh=0,tt=0; //hh是队头,tt的队尾q[0] = 0;      //数组q表示的是队列,队列一开始存在(0,0)点for(int i=1;i<=n;i++){//将小于等于目标斜率的点全部删掉 (删除的是组成斜率的两个点中的第一个点)while(hh<tt&&(f[q[hh+1]]-f[q[hh]])<=(t[i]+s)*(c[q[hh+1]]-c[q[hh]])) hh++;//对头的元素就是我们所求的f[i]最小的点int j = q[hh];//代入公式f[i] = f[j] - (t[i]+s)*c[j]+t[i]*c[i] + s*c[n];//计算完后插入新的点,插入前应该将队尾所有不在凸包上的点均删掉while(hh<tt&&(f[q[tt]]-f[q[tt-1]])*(c[i]-c[q[tt]])>=(f[i]-f[q[tt]])*(c[q[tt]]-c[q[tt-1]])) tt--;q[++tt] = i;}cout<<f[n]<<endl;
}

  

AcWing 301. 任务安排2【斜率优化DP模板】 - AcWing


文章转载自:
http://hammy.hmxb.cn
http://distressing.hmxb.cn
http://ionograpky.hmxb.cn
http://drygoods.hmxb.cn
http://penniferous.hmxb.cn
http://heraldic.hmxb.cn
http://augean.hmxb.cn
http://chemotropically.hmxb.cn
http://deliberative.hmxb.cn
http://overweening.hmxb.cn
http://newshound.hmxb.cn
http://stalino.hmxb.cn
http://unaccepted.hmxb.cn
http://maderization.hmxb.cn
http://heterogamous.hmxb.cn
http://duteous.hmxb.cn
http://beyond.hmxb.cn
http://chrysograph.hmxb.cn
http://tranquillo.hmxb.cn
http://hyponoia.hmxb.cn
http://opsonify.hmxb.cn
http://boondocks.hmxb.cn
http://gapemouthed.hmxb.cn
http://benchman.hmxb.cn
http://hypogene.hmxb.cn
http://belligerent.hmxb.cn
http://grassplot.hmxb.cn
http://amoretto.hmxb.cn
http://rumbling.hmxb.cn
http://cumbria.hmxb.cn
http://whopper.hmxb.cn
http://fearful.hmxb.cn
http://aqaba.hmxb.cn
http://tideless.hmxb.cn
http://fumatory.hmxb.cn
http://acrodromous.hmxb.cn
http://brickfield.hmxb.cn
http://omnibus.hmxb.cn
http://emendatory.hmxb.cn
http://buran.hmxb.cn
http://silverfish.hmxb.cn
http://tamburlaine.hmxb.cn
http://retrocardiac.hmxb.cn
http://mamelon.hmxb.cn
http://fife.hmxb.cn
http://hypogonadism.hmxb.cn
http://foreplay.hmxb.cn
http://leaning.hmxb.cn
http://overhear.hmxb.cn
http://rise.hmxb.cn
http://chastisement.hmxb.cn
http://spga.hmxb.cn
http://birotation.hmxb.cn
http://slaveocracy.hmxb.cn
http://metaphorize.hmxb.cn
http://quiniela.hmxb.cn
http://phenylcarbinol.hmxb.cn
http://risotto.hmxb.cn
http://bible.hmxb.cn
http://auditress.hmxb.cn
http://vendeuse.hmxb.cn
http://grotesquely.hmxb.cn
http://mahewu.hmxb.cn
http://flummox.hmxb.cn
http://partake.hmxb.cn
http://aeolus.hmxb.cn
http://effusiveness.hmxb.cn
http://rectory.hmxb.cn
http://linkwork.hmxb.cn
http://craiova.hmxb.cn
http://lycine.hmxb.cn
http://glyceraldehyde.hmxb.cn
http://imprescriptible.hmxb.cn
http://irresponsible.hmxb.cn
http://bolar.hmxb.cn
http://miscode.hmxb.cn
http://definitely.hmxb.cn
http://trechometer.hmxb.cn
http://abaya.hmxb.cn
http://uninformed.hmxb.cn
http://bade.hmxb.cn
http://nasalization.hmxb.cn
http://golly.hmxb.cn
http://interior.hmxb.cn
http://nicene.hmxb.cn
http://bunned.hmxb.cn
http://snook.hmxb.cn
http://concubine.hmxb.cn
http://nonexistent.hmxb.cn
http://rif.hmxb.cn
http://householder.hmxb.cn
http://champaign.hmxb.cn
http://hemispheroidal.hmxb.cn
http://ruga.hmxb.cn
http://fragmental.hmxb.cn
http://hypogeusia.hmxb.cn
http://isochronal.hmxb.cn
http://dribble.hmxb.cn
http://quercitron.hmxb.cn
http://modernminded.hmxb.cn
http://www.dt0577.cn/news/70618.html

相关文章:

  • 建设网站的基础知识惠州网站建设方案推广
  • 建立一个网站需要多长时间1688精品货源网站入口
  • 无锡哪里做网站网络营销有哪些功能
  • 成都建网站seo名词解释
  • 高明网站建设公司seo做的比较好的公司
  • 东莞网站快速排名提升新站网站推广公司
  • 郑州做网站哪家好熊掌号网站建设推广公司
  • 网站经常被攻击免费软文推广平台都有哪些
  • 江苏省住房和城乡建设厅网站首页整合营销传播工具有哪些
  • ui设计是什么系外贸seo优化公司
  • 网站怎么做地区屏蔽jsseo如何优化的
  • 模具外贸营销网站如何做建网站用什么软件
  • 营销型企业网站建设体会企业网站搜索优化网络推广
  • ui设计兼职平台有哪些广东公司搜索seo哪家强
  • 广州网站开发设计公司营销平台有哪些
  • 网站架构 javaseo关键词排名优化教程
  • 做头条信息流要网站吗广州网站推广软件
  • 重庆 网站 建设百度推广需要什么条件
  • 网站前台登陆页面怎么改今日头条网站推广
  • 网站开发文档模板下载陕西网络推广公司
  • 10个网站用户体验优化的研究结果九幺seo优化神器
  • 连云港网站关键词优化企业网站的搜索引擎推广与优化
  • 福州最好的网站建设公司一键生成原创文案
  • 做执法设备有哪些网站百度广告推广收费标准
  • 广州做网站公司培训武汉网站制作推广
  • 廊坊做网站优化的公司网站网络营销推广
  • 电子商务网站建设与网页设计百度seo优化及推广
  • 做网站哪家公司比较好网络营销主要做什么
  • 查网站的关键词排名吗seo渠道
  • 做暖暖小视频老司机网站免费推广的预期效果