日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Bone Collector II

發布時間:2024/10/5 编程问答 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Bone Collector II 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

http://acm.hdu.edu.cn/showproblem.php?pid=2639

The title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't seen it before,it doesn't matter,I will give you a link:?

Here is the link:?http://acm.hdu.edu.cn/showproblem.php?pid=2602?

Today we are not desiring the maximum value of bones,but the K-th maximum value of the bones.NOTICE that,we considerate two ways that get the same value of bones are the same.That means,it will be a strictly decreasing sequence from the 1st maximum , 2nd maximum .. to the K-th maximum.?

If the total number of different values is less than K,just ouput 0.

Input

The first line contain a integer T , the number of cases.?
Followed by T cases , each case three lines , the first line contain two integer N , V, K(N <= 100 , V <= 1000 , K <= 30)representing the number of bones and the volume of his bag and the K we need. And the second line contain N integers representing the value of each bone. The third line contain N integers representing the volume of each bone.?

Output

One integer per line representing the K-th maximum of the total value (this number will be less than 2?31).?

Sample Input

3 5 10 2 1 2 3 4 5 5 4 3 2 1 5 10 12 1 2 3 4 5 5 4 3 2 1 5 10 16 1 2 3 4 5 5 4 3 2 1

Sample Output

12 2 0 /* *@Author: STZG *@Language: C++ */ #include <bits/stdc++.h> #include<iostream> #include<algorithm> #include<cstdlib> #include<cstring> #include<cstdio> #include<string> #include<vector> #include<bitset> #include<queue> #include<deque> #include<stack> #include<cmath> #include<list> #include<map> #include<set> //#define DEBUGusing namespace std; typedef long long ll; const int N=10000; const double PI = acos(-1.0); const double EXP = 1E-8; const int INF = 0x3f3f3f3f; int t,n,m,k,v; int a[200],b[200],dp[N][50],A[50],B[50]; void init(){memset(dp,0,sizeof(dp));memset(A,0,sizeof(A));memset(B,0,sizeof(B)); } int main() { #ifdef DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout); #endifscanf("%d",&t);while(t--){scanf("%d%d%d",&n,&v,&k);init();for(int i=1;i<=n;i++)scanf("%d",&a[i]);for(int i=1;i<=n;i++)scanf("%d",&b[i]);for(int i=1;i<=n;i++){for(int j=v;j>=b[i];j--){for(int p=1;p<=k;p++){A[p]=dp[j-b[i]][p]+a[i];B[p]=dp[j][p];}int x=1,y=1,z=1;A[k+1]=B[k+1]=-1;while(z<=k&&(A[x]!=-1||B[y]!=-1)){if(A[x]>B[y]){dp[j][z]=A[x++];}else{dp[j][z]=B[y++];}if(dp[j][z]!=dp[j][z-1])++z;}}}printf("%d\n",dp[v][k]);}//cout << "Hello world!" << endl;return 0; }

?

總結

以上是生活随笔為你收集整理的Bone Collector II的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 在线观看亚洲精品视频 | 久久国产精品一区 | 国产成人精品无码免费看在线 | 黄色免费av | 国产av一区二区三区精品 | 韩日av片 | 亚洲人成小说 | 野外吮她的花蒂高h在线观看 | av作品在线 | 日韩欧美亚洲精品 | 狠狠干狠狠搞 | 亚洲人成网址 | 国产伦子伦对白视频 | 久久一二 | 这里只有精品免费视频 | 中文字幕一区二区三区人妻 | 蜜桃精品噜噜噜成人av | 国产又粗又长视频 | 国产伦精品一区二区三区妓女 | 国产美女白浆 | 中文字幕第4页 | 亚洲欧美网址 | 在线观看视频中文字幕 | 国产乱淫av一区二区三区 | 成人午夜影视在线观看 | 三级全黄做爰龚玥菲在线 | 黄色一级录像片 | 黄毛片在线观看 | 亚洲欧美国产精品久久久久久久 | 国产免费又黄又爽又色毛 | 红桃视频成人在线 | 日韩欧美视频在线播放 | 亚洲成人a v | 色婷婷综合久久 | 88xx成人永久免费观看 | 国产精品嫩草久久久久 | 国产成人精品无码免费看81 | 国产chinese男男gaygay视频 | 久久久久久午夜 | 在线视频免费观看一区 | 日韩精品一区二区三区国语自制 | 婷婷精品一区二区三区 | 毛片链接 | 中文字幕乱码亚洲精品一区 | 亚洲激情文学 | 亚洲欧美一区二区三区在线 | 国产午夜一区二区 | 狠狠爱成人 | 久草综合在线视频 | 又黄又爽网站 | 精品h视频 | 中文字幕日韩经典 | 69福利网 | 老司机午夜精品视频 | 91观看视频 | 午夜播放 | 草草影院发布页 | 成人免费在线电影 | 久久一区视频 | 国产区精品| www.麻豆av.com | 高潮又黄又刺激 | 亚洲av成人无码一区二区三区在线观看 | 国产一区日韩 | 欧美一区二区三区视频在线观看 | 中国一级免费毛片 | 婷婷五月精品中文字幕 | 少妇名器的沉沦 | 麻豆一区二区三区精品视频 | 香蕉视频免费 | 欧美人体一区二区 | 五月少妇 | 狠久久| 中文字幕在线观看视频www | av在线不卡免费看 | 在线观看成人网 | 欧美一区二区三区国产 | 国产欧美a | 国产三区四区视频 | 亚洲成人aa | 欧美特级a | 捆绑少妇玩各种sm调教 | www.96av| 青青青国产在线 | xxxx18国产| 少妇高潮网站 | 一区二区视频国产 | 五月婷婷狠狠 | 色婷婷av一区二区三区在线观看 | 91大神在线免费观看 | av一二三四区 | 天堂在线中文资源 | 免费看一级黄色片 | 成人福利网址 | 在线观看日本中文字幕 | 日韩精品人妻无码一本 | 日韩在线观看一区 | 麻豆蜜桃视频 | 一本亚洲 |