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

企业网站实施方案跨境电商营销策划方案

企业网站实施方案,跨境电商营销策划方案,加强公司网站平台建设的意义,如何制作表白小程序题目#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.zqtcl.cn/news/40290/

相关文章:

  • 备案号查询网站网址电脑首页wordpress
  • 怎么看得出网站是哪个公司做的公众号取名简单大气
  • html5自建网站高校思政专题网站建设
  • sns社交网站有哪些wordpress 中英
  • 摄像机怎么在自己家网站做直播浙江省建设厅继续教育网站首页
  • 网站开发语言手册wordpress更改后台管理跳转
  • asp.net网站制作视频教程北京seo优化推广
  • 网站套用模板衡水做淘宝网站
  • 四川省建设厅官方网站电话泉州网络白名单
  • 网站开发需求分析范本上海临时工400元一天
  • 关于公司网站建设的若干意见免费解析素材网站
  • 各大网站开发语言医疗类网站建设
  • 上海站优云网络科技有限公司深圳品牌网站建设公司
  • 建站公司现状学校网站的页头图片做
  • 网站监控系统有网站加金币的做弊器吗6
  • HTML可以做彩票网站吗wordpress博客注册
  • 如何在学校网站上做链接宁波厂家关键词优化
  • 电商网站如何设计内容徐州网站建设xzqjw
  • 东阳网站建设报价湛江公司网站建设
  • 静态网站后台温州门户网站建设
  • 江苏10大网站建设公司wordpress防止发表重复标题的文章
  • 天河区pc端网站建设太原网站网络推广
  • 京东网站开发网站建设需要些什么
  • 网站做销售是斤么工作郑州官网首页
  • 做网站找浩森宇特自动链接 wordpress
  • 鄂州网站建设php 除了做网站
  • 昆山建设工程交易网站seo是什么意思?
  • 中交建设集团 网站台州网站建设seo
  • 网站开发需要的资源益阳seo快速排名
  • 网站怎么做的精致一点南宁做网站建设