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

杭州网站建设哪家设计好论坛类的网站怎么做

杭州网站建设哪家设计好,论坛类的网站怎么做,广西建设厅网站是什么,建设母婴网站的目的题意#xff1a; 大意就是给一个序列#xff0c;可能有重复数字#xff0c;有x次机会为这个序列填上一个数字#xff0c;问最终从里面获得的1~v连续子序列的v最大是多少。 题目: Dreamoon is a big fan of the Codeforces contests. One day, he claimed that he will …题意 大意就是给一个序列可能有重复数字有x次机会为这个序列填上一个数字问最终从里面获得的1~v连续子序列的v最大是多少。 题目: Dreamoon is a big fan of the Codeforces contests. One day, he claimed that he will collect all the places from 1 to 54 after two more rated contests. It’s amazing! Based on this, you come up with the following problem: There is a person who participated in n Codeforces rounds. His place in the first round is a1, his place in the second round is a2, …, his place in the n-th round is an. You are given a positive non-zero integer x. Please, find the largest v such that this person can collect all the places from 1 to v after x more rated contests. In other words, you need to find the largest v, such that it is possible, that after x more rated contests, for each 1≤i≤v, there will exist a contest where this person took the i-th place. For example, if n6, x2 and a[3,1,1,5,7,10] then answer is v5, because if on the next two contest he will take places 2 and 4, then he will collect all places from 1 to 5, so it is possible to get v5. Input The first line contains an integer t (1≤t≤5) denoting the number of test cases in the input. Each test case contains two lines. The first line contains two integers n,x (1≤n,x≤100). The second line contains n positive non-zero integers a1,a2,…,an (1≤ai≤100). Output For each test case print one line containing the largest v, such that it is possible that after x other contests, for each 1≤i≤v, there will exist a contest where this person took the i-th place. Example Input 5 6 2 3 1 1 5 7 10 1 100 100 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 57 80 60 40 20 Output 5 101 2 2 60 分析 其实读懂这道题的题意基本都能写出来A题一般都简单这里说下我对这道题的分析 1.我首先想到map记录出现的值。 2.用一个while循环直到找到第m次的“空位” 3.结果用了减二因为while循环先判断再运行再判断这样就会多加2 4.起始即为1题目要求从1开始。 AC代码 #includestdio.h #includestring.h #includemap #includealgorithm using namespace std; const int M1e310; int t,n,m,ans,k; int a[M]; int main() {scanf(%d,t);while(t--){mapint,intmp;scanf(%d%d,n,m);for(int i0;in;i){scanf(%d,a[i]);mp[a[i]];}k0;ans1;while(km){if(!mp[ans])k;ans;}printf(%d\n,ans-2);} }In addtion 最近想提高下自己博客的阅读量就会开始尽量把以后所有写过的CodeForces发到博客上因为题会新一点也希望能帮到你们我会开一个新分类。就酱
http://www.zqtcl.cn/news/671528/

相关文章:

  • 做网站页面一般用什么软件网站建设项目说明书
  • 做国外lead应该做什么网站网站运营报告
  • 建立一个自己的网站需要多少钱我的世界查找建筑网站
  • 广州网站建设互广做响应式网站设计图是多大的
  • 网站建设 运维 管理包括建大网站首页
  • 快手做任务网站python基础教程作者
  • 网站添加 百度商桥企信网查询
  • 用易语言可以做网站吗西安外贸网站开发
  • 常用网站推广方法电商便捷的网站建设平台
  • 做网站免费的app是什么免费公司注册
  • 做平面素材比较好的网站网络系统设计的步骤
  • 西安网站建设 乐云seo全国旅游景点网站开源
  • 中山快速做网站价格网站投稿源码
  • 免费网站建设教程青岛网站建设收费哪个平台好
  • 关于网站建设外文文献金蝶软件多少钱一套
  • 有高并发量门户网站开发经验国家商标局官网查询
  • 正规的招聘网站可信网站标志
  • 网站举报能不能查到举报人佛山企业网站建设电话
  • 家居网站建设如何现在去长沙会被隔离吗
  • 电子烟网站建设win2008iis7配置网站
  • 做网站的是什么职业微信公众号模板素材网站
  • 重庆川九建设有限责任公司官方网站成都网站海口网站建设
  • 珠宝 网站模板如何做公司官网
  • 贵阳网站制作免费iis7.5网站权限配置
  • 温州网站建设专业的公司移动互联网开发学什么专业
  • 集团企业网站建设方案运动服饰网站建设项目规划书
  • 简述网站建设的一般步骤简约的网站建设
  • wordpress删除用户头像昆明做网站优化的公司
  • 西安响应式网站网页设计的模板
  • 古装衣服店网站建设页面网站执行速度