【枚举标记】HDU4907Task schedule【BestCoder Round #3】
来源:互联网 发布:ubuntu怎么上传lrzsz包 编辑:程序博客网 时间:2024/04/30 19:08
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4907
#include<iostream>#include<cstdio>#include<cstring>using namespace std;const int N=200005;int tmp[N];int a[N],ans[N];int n,m;void Input(){ memset(tmp,0,sizeof(tmp)); cin>>n>>m; int k,Min=N; for(int i=0;i<n;i++){ cin>>k; tmp[k]=1; } for(int i=N;i>0;i--){ if(tmp[i]==0) Min=i; ans[i]=Min; } for(int j=0;j<m;j++){ cin>>k; cout<<ans[k]<<endl; }}int main(){ int t; cin.sync_with_stdio(false); cin>>t; while(t--){ Input(); } return 0;}
阅读全文
0 0
- 【枚举标记】HDU4907Task schedule【BestCoder Round #3】
- BestCoder Round #3 Task schedule
- HDU4907Task schedule
- HDU 4907 Task schedule(标记+二分或直接处理也行)BestCoder Round #3
- BestCoder-Round #3 1001 Task schedule
- HDU 4907 Task schedule(BestCoder Round #3 )
- HDU4907Task schedule二分
- HDU 4907 - Task schedule(BestCoder Round #3 简单DP)
- BestCoder Round #3 1001 && HDU 4907 Task schedule (预处理)
- BestCoder Round #3 A hdu 4907 Task schedule
- BestCoder Round #3 BestCoder Sequence
- HDU4907Task schedule(并查集)
- hdu 4907 & BestCoder Round #3 Task schedule(哈希运用)
- [BestCoder Round #3] hdu 4907 Task schedule (模拟简单题)
- BestCoder Round #92【map,枚举,DP】
- 【枚举】HDU5944Fxx and string【BestCoder Round #89】
- 【枚举计数】HDU5907Find Q【BestCoder Round #88】
- 【枚举】HDU5104Primes Problem【BestCoder Round #18】
- C语言 Linux文件系统调用 分组
- 了解TCP三次握手、四次挥手以及syn攻击
- Json web token 详解(二)
- 数据结构排序法之堆排序he归并排序
- uva-439 骑士的移动
- 【枚举标记】HDU4907Task schedule【BestCoder Round #3】
- OpenGL 03 绘制命令
- Linux 之GIT 安装(centos6.5)
- 文件上传与下载权限的控制
- 2017.08.06
- tcp头部没有数据长度信息
- LeetCode之Search Insert Position
- this super
- win10管理员已阻止你运行此应用”解决方法