日韩性视频-久久久蜜桃-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的全部內容,希望文章能夠幫你解決所遇到的問題。

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

主站蜘蛛池模板: 色哟哟无码精品一区二区三区 | 成人性视频网站 | 青青草成人免费在线视频 | 久久久久久久久久久久久久久久久 | 精品国产乱码久久久久久牛牛 | 一区二区内射 | 色噜噜狠狠一区二区 | jizz高潮 | 日日射av| 国产一区二区三区免费 | 女人一区二区三区 | 91最新视频| 啪啪综合网| 久久水蜜桃 | 久久影院国产 | 日批在线视频 | 欧美日韩一区二区三区在线视频 | 国产又粗又黄又爽又硬 | 日本一本一道 | 久热国产精品视频 | 久久国产精品-国产精品 | 欧美性生活精品 | 日本一区二区三区四区五区 | 日韩av专区 | 欧美日韩一区二区三区在线观看 | 欧美不卡视频 | 国产亚洲精品成人av在线 | 亚洲成人激情av | 理论片高清免费理伦片 | 这里只有精品9 | 丝袜美女av| 波多野结衣av在线观看 | 狠狠操人人干 | 91极品视觉盛宴 | 久久午夜视频 | 成人综合在线观看 | 一本色道久久hezyo无码 | 他趴在我两腿中间添得好爽在线看 | 婷婷六月天 | 午夜秋霞影院 | 日韩啊啊啊 | 欧美视频一区二区在线 | 久久国产欧美日韩精品 | 爱爱视频在线免费观看 | 伊人影院久久 | 小镇姑娘国语版在线观看免费 | 亚洲精品av中文字幕在线在线 | 亚洲av首页在线 | 国产综合精品一区二区三区 | 日本 奴役 捆绑 受虐狂xxxx | 少妇一级1淫片 | 亚洲小说网 | 肥婆大荫蒂欧美另类 | 香蕉久久久久久 | 亚洲一| 久久一本精品 | 迈开腿让我尝尝你的小草莓 | 免费欧美在线 | 无码人妻精品一区二区蜜桃网站 | 热久久av | 亚洲精品久久久久久无码色欲四季 | 欧美日韩综合在线 | 欧美videossex极品 | 久久综合精品国产二区无码不卡 | 视频一区国产精品 | 亚洲日本视频在线观看 | 久久久久久一 | www成人在线 | 精品国模一区二区三区欧美 | 中文字幕第80页 | 观看av| 老鸭窝一区二区 | 尤物在线精品 | 亚洲自拍第二页 | 91爱啪啪 | 四虎影院国产精品 | 91国在线| jlzzzjlzzz国产免费观看 | 久久超碰av | 成人免费无遮挡无码黄漫视频 | 久久婷婷婷 | 四虎视频国产精品免费入口 | 亚洲国产成人精品女人久久 | 国产女人18毛片18精品 | 亚洲精品久久久久久久蜜桃 | 国产91清纯白嫩初高中在线观看 | 少妇精品久久久久www | 日韩一区在线看 | 人超碰 | 欧美三级黄色 | 欧美xxxxx自由摘花 | 自拍偷拍亚洲视频 | 国产亚洲精品久久久久婷婷瑜伽 | 日韩不卡高清视频 | 亚洲第十页| 成人激情小说网站 | 男人在线视频 | 在线国产区 | 强伦人妻一区二区三区视频18 |