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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

dp_Pku1887

發布時間:2025/3/20 编程问答 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 dp_Pku1887 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<span style="color:#000099;">/* A - 單純dp 示例 Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u SubmitStatus Description A military contractor for the Department of Defense has just completed a series of preliminary tests for a new defensive missile called the CATCHER which is capable of intercepting multiple incoming offensive missiles. The CATCHER is supposed to be a remarkable defensive missile. It can move forward, laterally, and downward at very fast speeds, and it can intercept an offensive missile without being damaged. But it does have one major flaw. Although it can be fired to reach any initial elevation, it has no power to move higher than the last missile that it has intercepted.The tests which the contractor completed were computer simulations of battlefield and hostile attack conditions. Since they were only preliminary, the simulations tested only the CATCHER's vertical movement capability. In each simulation, the CATCHER was fired at a sequence of offensive missiles which were incoming at fixed time intervals. The only information available to the CATCHER for each incoming missile was its height at the point it could be intercepted and where it appeared in the sequence of missiles. Each incoming missile for a test run is represented in the sequence only once.The result of each test is reported as the sequence of incoming missiles and the total number of those missiles that are intercepted by the CATCHER in that test.The General Accounting Office wants to be sure that the simulation test results submitted by the military contractor are attainable, given the constraints of the CATCHER. You must write a program that takes input data representing the pattern of incoming missiles for several different tests and outputs the maximum numbers of missiles that the CATCHER can intercept for those tests. For any incoming missile in a test, the CATCHER is able to intercept it if and only if it satisfies one of these two conditions:The incoming missile is the first missile to be intercepted in this test. -or- The missile was fired after the last missile that was intercepted and it is not higher than the last missile which was intercepted. Input The input data for any test consists of a sequence of one or more non-negative integers, all of which are less than or equal to 32,767, representing the heights of the incoming missiles (the test pattern). The last number in each sequence is -1, which signifies the end of data for that particular test and is not considered to represent a missile height. The end of data for the entire input is the number -1 as the first value in a test; it is not considered to be a separate test. Output Output for each test consists of a test number (Test #1, Test #2, etc.) and the maximum number of incoming missiles that the CATCHER could possibly intercept for the test. That maximum number appears after an identifying message. There must be at least one blank line between output for successive data sets.Note: The number of missiles for any given test is not limited. If your solution is based on an inefficient algorithm, it may not execute in the allotted time. Sample Input 389 207 155 300 299 170 158 65 -1 23 34 21 -1 -1 Sample Output Test #1:maximum possible interceptions: 6Test #2:maximum possible interceptions: 2 By Grant Yuan 2014.7.16 */ #include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> using namespace std; int a[100005]; int f[100005]; int n; int ct=1; int main() { int t;while(t!=-1){cin>>a[0];if(a[0]==-1)break;memset(f,0,sizeof(f));for(int i=1;;i++){scanf("%d",&a[i]);n=i;f[i]=1;if(a[i]==-1)break;}f[0]=1;for(int i=0;i<n;i++){for(int j=0;j<i;j++){if(a[j]>=a[i]){if(f[j]>=f[i])f[i]=f[j]+1;}}}int max=0;for(int i=0;i<n;i++)if(f[i]>max) max=f[i];printf("Test #%d:\n",ct++);printf(" maximum possible interceptions: %d\n",max);cout<<endl;}return 0; } </span>

版權聲明:本文博主原創文章。博客,未經同意不得轉載。

轉載于:https://www.cnblogs.com/gcczhongduan/p/4850640.html

總結

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

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

主站蜘蛛池模板: 蜜桃av免费| 黑人巨大xxxxx性猛交 | 一级黄色片免费播放 | 毛片毛片女人毛片毛片 | 色欲av无码精品一区 | 色婷婷激情综合 | 成人mv| 狠狠撸视频| 黄色片网站在线看 | 成人黄色一级 | 偷拍第一页 | 91极品国产 | 中日韩欧美在线观看 | 一区二区在线精品 | 色黄网站 | 青青视频免费在线观看 | 无码人妻丰满熟妇啪啪 | 91婷婷色| av网站在线看 | 男生把女生困困的视频 | 人人爽人人香蕉 | 欧美成人午夜精品久久久 | 少妇在线 | 黑人一级视频 | 激情一区 | 永久免费看成人av的动态图 | 亚洲特级黄色片 | 国产精在线 | 精品精品视频 | 懂色av中文字幕 | 青草青草久热 | 国产18在线| 国产日韩精品电影 | 成人在线视频免费看 | а√天堂资源官网在线资源 | 免费观看高清在线 | 精品久久国产字幕高潮 | 亚洲免费二区 | 日本xxxxxxxxx| 免费看国产精品 | 亚洲狠狠婷婷综合久久久久图片 | 久久叉 | 日本h在线 | 精品视频第一页 | 欧美激情综合色综合啪啪五月 | 成人av影院在线观看 | 国色天香网站 | 国产熟妇乱xxxxx大屁股网 | 欧美做受喷浆在线观看 | 国产学生美女无遮拦高潮视频 | 久久青青国产 | 欧美超碰在线观看 | 亚洲精品在线观看视频 | 可以在线看黄的网站 | 亚洲xx在线| 99久久人妻无码精品系列 | av天堂一区二区 | 午夜影院在线观看18 | 日本激情网站 | 欧美激情一区二区三级高清视频 | 亚洲午夜久久久久久久久久久 | 裸体按摩www性xxxcom | 欧美成人免费在线 | 精品久久久久久无码人妻 | 成人免费黄色网址 | 成人在线视频观看 | av资源网址 | 亚洲综合自拍偷拍 | 小少妇哺乳喂奶播放 | 天天干夜夜添 | 日韩av免费在线 | 日韩欧美视频免费在线观看 | 久久九九国产 | 青青青在线免费观看 | 亚洲欧美国产精品专区久久 | 中文字幕一区二区三区精彩视频 | 肉色欧美久久久久久久免费看 | 日韩黄片一区二区三区 | 黄色永久免费网站 | 五月天爱爱 | 人妻中文字幕一区二区三区 | 欧美性生话 | 色男人影院 | 天堂中文资源在线观看 | jizz在线播放| 超碰在线人人 | 日日狠狠久久 | wwwwww国产| 最近日韩中文字幕中文 | 亚洲啪av永久无码精品放毛片 | 精品欧美日韩 | 国产黄色av网站 | 国产成人激情视频 | 欧美精品啪啪 | 熟妇女人妻丰满少妇中文字幕 | 亚洲精品乱码久久久久久蜜桃动漫 | 午夜免费毛片 | 九九热只有精品 | jizz黑人|