博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU4268(贪心+multiset)
阅读量:5268 次
发布时间:2019-06-14

本文共 1605 字,大约阅读时间需要 5 分钟。

Alice and Bob's game never ends. Today, they introduce a new game. In this game, both of them have N different rectangular cards respectively. Alice wants to use his cards to cover Bob's. The card A can cover the card B if the height of A is not smaller than B and the width of A is not smaller than B. As the best programmer, you are asked to compute the maximal number of Bob's cards that Alice can cover.
Please pay attention that each card can be used only once and the cards cannot be rotated.

InputThe first line of the input is a number T (T <= 40) which means the number of test cases.

For each case, the first line is a number N which means the number of cards that Alice and Bob have respectively. Each of the following N (N <= 100,000) lines contains two integers h (h <= 1,000,000,000) and w (w <= 1,000,000,000) which means the height and width of Alice's card, then the following N lines means that of Bob's.
OutputFor each test case, output an answer using one line which contains just one number.
Sample Input

221 23 42 34 532 35 76 84 12 53 4

Sample Output

12 没能AC的代码,恳请各位大佬们帮我看看哪里出错了。
1 #include 
2 #include
3 #include
4 #include
5 #include
6 #include
7 #include
8 using namespace std; 9 int n,m,t,x,y;10 struct node11 {12 int h,w;13 node(int a,int b){h=a,w=b;}14 friend bool operator<(node x,node y)15 {16 if(x.h!=y.h)17 return x.h
s;28 multiset
::iterator it;29 int ans=0;30 scanf("%d",&m);31 for(int i=0;i

 

转载于:https://www.cnblogs.com/zuiaimiusi/p/10885587.html

你可能感兴趣的文章
Sping注解:注解和含义
查看>>
站立会议第四天
查看>>
如何快速掌握一门技术
查看>>
利用AMPScript获取Uber用户数据的访问权限
查看>>
vagrant 同时设置多个同步目录
查看>>
python接口自动化28-requests-html爬虫框架
查看>>
生成随机数的模板
查看>>
Mysql 数据库操作
查看>>
转:linux终端常用快捷键
查看>>
A-Softmax的总结及与L-Softmax的对比——SphereFace
查看>>
UVa 11059 最大乘积
查看>>
数组分割问题求两个子数组的和差值的小
查看>>
composer 报 zlib_decode(): data error
查看>>
linux下WPS的使用
查看>>
Web Api 利用 cors 实现跨域
查看>>
hdu 3938 并查集
查看>>
instanceof
查看>>
《深入分析Java Web技术内幕》读书笔记之JVM内存管理
查看>>
python之GIL release (I/O open(file) socket time.sleep)
查看>>
2015/8/4 告别飞思卡尔,抛下包袱上路
查看>>