F[i]表示第一个机器用了i的时间,第二个机器的最小时间 转移即可 #include<cstdio> #include<algorithm> using namespace std; int n,m,F[30005]; int main(){ scanf("%d",&n); for (int i=1; i<=5*n; i++) F[i]=1e9; for (int i=1; i<=n; i++){ int a,b,c; scanf("…
Search GO 说明:输入题号直接进入相应题目,如需搜索含数字的题目,请在关键词前加单引号 Problem ID Title Source AC Submit Y 1000 A+B Problem 10983 18765 Y 1036 [ZJOI2008]树的统计Count 5293 13132 Y 1588 [HNOI2002]营业额统计 5056 13607 1001 [BeiJing2006]狼抓兔子 4526 18386 Y 2002 [Hnoi2010]Bounce 弹飞绵羊 43…
用f[i][j]表示完成前i个任务,在A机器上加工j小时时B机器上最少要工作多小时,转移就分为三种,即$f[i][j]=min(f[i-1][j-t1],f[i-1][j]+t2,f[i-t3]+t3)$,然后这个东西可以用类似于背包的方式优化到1维(注意要从大到小枚举) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n,a,b,c,s,ans,f[30005]; 4 int main(){ 5 scanf("%d&qu…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=4800 Problem Description A role-playing game (RPG and sometimes roleplaying game) is a game in which players assume the roles of characters in a fictional setting. Players take responsibility for acting…