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

中国安能建设总公司网站wordpress 设置域名

中国安能建设总公司网站,wordpress 设置域名,最新新闻事件50字,网站开发用的是什么语言题目#xff1a;白书p274 题意: KTV里面有n首歌曲你可以选择,每首歌曲的时长都给出了. 对于每首歌曲,你最多只能唱1遍. 现在给你一个时间限制t (t10^9) , 问你在最多t-1秒的时间内可以唱多少首歌曲num , 且最长唱歌时间是多少time (time必须t-1) ? 最终输出num1 和…题目白书p274 题意:  KTV里面有n首歌曲你可以选择,每首歌曲的时长都给出了. 对于每首歌曲,你最多只能唱1遍. 现在给你一个时间限制t (t10^9) , 问你在最多t-1秒的时间内可以唱多少首歌曲num , 且最长唱歌时间是多少time (time必须t-1) ? 最终输出num1 和 time678 即可.  注意: 你需要优先让歌曲数目最大的情况下,再去选择总时长最长的.  解析:  每种歌曲只能用一次,所以是比较水的01背包题  最后枚举找到最大曲目数量并且时间尽量靠后即可 题目中t的范围是1e9但实际的t不会超过10000这就可以转化为01背包问题 (If you smiled when you see the title, this problem is for you ^_^) For those who don’t know KTV, see: http://en.wikipedia.org/wiki/Karaoke_box There is one very popular song called Jin Ge Jin Qu(). It is a mix of 37 songs, and is extremely long (11 minutes and 18 seconds) — I know that there are Jin Ge Jin Qu II and III, and some other unofficial versions. But in this problem please forget about them. Why is it popular? Suppose you have only 15 seconds left (until your time is up), then you should select another song as soon as possible, because the KTV will not crudely stop a song before it ends (people will get frustrated if it does so!). If you select a 2-minute song, you actually get 105 extra seconds! ....and if you select Jin Ge Jin Qu, you’ll get 663 extra seconds!!! Now that you still have some time, but you’d like to make a plan now. You should stick to the following rules: • Don’t sing a song more than once (including Jin Ge Jin Qu). • For each song of length t, either sing it for exactly t seconds, or don’t sing it at all. • When a song is finished, always immediately start a new song. Your goal is simple: sing as many songs as possible, and leave KTV as late as possible (since we have rule 3, this also maximizes the total lengths of all songs we sing) when there are ties. Input The first line contains the number of test cases T (T ≤ 100). Each test case begins with two positive integers n, t (1 ≤ n ≤ 50, 1 ≤ t ≤ 109 ), the number of candidate songs (BESIDES Jin Ge Jin Qu) and the time left (in seconds). The next line contains n positive integers, the lengths of each song, in seconds. Each length will be less than 3 minutes — I know that most songs are longer than 3 minutes. But don’t forget that we could manually “cut” the song after we feel satisfied, before the song ends. So here “length” actually means “length of the part that we want to sing”. It is guaranteed that the sum of lengths of all songs (including Jin Ge Jin Qu) will be strictly larger than t. Output For each test case, print the maximum number of songs (including Jin Ge Jin Qu), and the total lengths of songs that you’ll sing. Explanation: In the first example, the best we can do is to sing the third song (80 seconds), then Jin Ge Jin Qu for another 678 seconds. In the second example, we sing the first two (306999 seconds). Then we still have one second left, so we can sing Jin Ge Jin Qu for extra 678 seconds. However, if we sing the first and third song instead (3070100 seconds), the time is already up (since we only have 100 seconds in total), so we can’t sing Jin Ge Jin Qu anymore! Sample Input 2 3 100 60 70 80 3 100 30 69 70 Sample Output Case 1: 2 758 Case 2: 3 777 #includestdio.h #includestring.h #includemap #includealgorithm using namespace std; int t,m,n; int dp[110]; int w[10000010]; int main() {int k1;scanf(%d,t);while(t--){scanf(%d%d,m,n);for(int i0; im; i)scanf(%d,dp[i]);memset(w,-1,sizeof(w));w[0]0;/**care*/for(int i0; im; i)for(int jn-1; jdp[i]; j--)w[j]max(w[j],w[j-dp[i]]1);int ans0,sum;for(int i0;in;i){if(answ[i]){answ[i];sumi;}}printf(Case %d: %d %d\n,k,ans1,sum678);}return 0; }
http://www.yutouwan.com/news/448595/

相关文章:

  • 如何迅速k掉网站室内设计学校排名
  • 导航网址大全成都关键词优化平台
  • 重庆企业做网站关于设计图的网站
  • 外包做的网站 需要要源代码吗北京建设高端网站的
  • 我要表白网站在线制作西安 做网站
  • 台州市网站建设电脑软件开发工具
  • 主流做网站视频链接生成器
  • 沈阳单页网站制作网站被入侵
  • 私人订制网站建设企业通用网站模板
  • 易奇秀网站软件开发工具分类
  • 个人网站赚广告费科技成果转化
  • wordpress曹鹏系统优化的方法举例
  • 如何加强网站信息管理建设8月4号建设部网站
  • php网站开发方案网页设计实训报告5000字
  • 做自媒体有哪些网站网页在线小游戏
  • 开源的网站系统宁波建设工程报名网站
  • 宁波网站建设制作公司哪家好wordpress获取帖子标签
  • 淄博建网站多少钱企业网站 设
  • 大连网站建设网站域没到期不能续费吗
  • 小红书网站开发费用无锡工程建设招标网站
  • 调试网站解析域名影响西安网页设计招聘信息
  • 手机网站开发工具 2018品牌建设的六个步骤
  • 福建省鑫通建设有限公司网站重庆网站建设jwzcq
  • 西安大型网站建设怎么自己做一个网站平台
  • 天门网站建设网站建设布局设计
  • 成都市高新区规划建设局网站网站seo外包公司有哪些
  • 做美工要开通什么网站的会员呢手机上可以做网站
  • 网站横幅怎么制作教程学建设网站去哪里学
  • 网站关键词快排名做网站 (公司)
  • 济南赢动网站建设提高网站权重的方法