HDU 5596
来源:互联网 发布:flame软件前景 编辑:程序博客网 时间:2024/05/17 23:48
#include<stdio.h>#include<algorithm>#include<math.h>#include<queue>#include<string.h>#include<stack>using namespace std;const int maxn = 1e5+10;int c[maxn];struct node{ int data; int id;}a[maxn];int main(){ int T; scanf("%d",&T); while(T--) { int n,m; scanf("%d%d",&n,&m); for(int i = 1;i<=n;i++) { scanf("%d%d",&a[i].id,&a[i].data); } int x; memset(c,0,sizeof(c)); for(int i = 1;i<=m;i++) { scanf("%d",&x); c[x]++; } int ans= n; int max1= -1; int max2= -1; for(int i= n;i>=1;i--) { max1-=c[i]; max2-=c[i]; if(a[i].id ==1) { //max1-=c[i]; if(a[i].data<max2) { ans--; } max1= max(max1,a[i].data); } else { if(a[i].data<max1) { ans--; } max2= max(max2,a[i].data); } } printf("%d\n",ans); } return 0;}
0 0
- HDU 5596
- hdu 5596
- hdu 5596
- hdu-5596 优先队列
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- hdu
- hdu-
- iOS项目之Swift新闻App(六)—侧栏菜单的实现
- 搭建Sqoop开发环境
- Apache Ant 实现自动化部署
- 继承(Java)
- border制作带箭头的提示框等好看的效果
- HDU 5596
- Ogre:Animation(Ogre中的动画)
- 【原创】面向对象思想入门(示范语言:Java)
- HTML5中<meta>标签的学习
- 贪吃蛇
- Windows Form线程同步
- vc++ win32项目添加文本编辑框、静态文本、按钮、Richedit等控件
- hdu5597GTW likes function 欧拉函数
- 文章标题