题意:有 k 个人需要买电影票,a[i] 表示第 i 个人单独买票要花费的时间,b[i] 表示第 i-1 个和第 i 个人一起买票需要花费的时间,问卖给所有人各一张票最少需要到什么时候. dp[i]表示卖完第 i 个人需要花费的最短时间 dp[i]=min(dp[i-1]+a[i],dp[i-2]+b[i]); 初始化:dp[0]=0;dp[1]=a[1]; #include<stdio.h> #include<string.h> ; int a[maxn],b[maxn]; in…
Tickets Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3917 Accepted Submission(s): 1968 Problem Description Jesus, what a great movie! Thousands of people are rushing to the cinema. However…
Tickets Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8077 Accepted Submission(s): 4101 Problem Description Jesus, what a great movie! Thousands of people are rushing to the cinema. However…
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1260 Tickets Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5097 Accepted Submission(s): 2673 Problem Description Jesus, what a great mov…
题目链接 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…