hdu 4022 STL】的更多相关文章

题意:给你n个敌人的坐标,再给你m个炸弹和爆炸方向,每个炸弹可以炸横排或竖排的敌人,问你每个炸弹能炸死多少个人. /* HDU 4022 G++ 1296ms */ #include<stdio.h> #include<iostream> #include<set> #include<map> #include<algorithm> using namespace std; // 建立一个 map,从 int 到 一个 multiset 容器的映…
orz kss太腻害了. 一.set和multiset基础 set和multiset会根据特定的排序准则,自动将元素进行排序.不同的是后者允许元素重复而前者不允许. 需要包含头文件: #include <set> set和multiset都是定义在std空间里的类模板: 二.set和multiset的功能 和所有关联式容器类似,通常使用平衡二叉树完成.事实上,set和multiset通常以红黑树实作而成. 自动排序的优点是使得搜寻元素时具有良好的性能,具有对数时间复杂度.但是造成的一个缺点就是…
Bombing From:HDU, 4022 Submit Time Limit: 4000/2000 MS (Java/Others)      Memory Limit: 65768/65768 K (Java/Others) Problem Description It's a cruel war which killed millions of people and ruined series of cities. In order to stop it, let's bomb the…
题目 参考了     1     2 #define _CRT_SECURE_NO_WARNINGS //用的是STL中的map 和 multiset 来做的,代码写起来比较简洁,也比较好容易理解. //multiset可以允许重复 //multiset<int>::iterator it; 用来遍历 #include<stdio.h> #include<string.h> #include<algorithm> #include<iostream&g…
人工模拟.. #include<stdio.h> #include<iostream> #include<algorithm> #include<vector> #include<cmath> #include<queue> #include<set> #include<map> using namespace std; #define N 10100 #define inf 1000000010 map<…
题意描述半天描述不好,直接粘贴了 Now your team is participating a programming contest whose rules are slightly different from ICPC. This contest consists of N problems, and you must solved them in order: Before you solve the (i+1)th problem, you must solve the ith p…
简单例题 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1412 list 相关博客:http://www.cnblogs.com/fangyukuan/archive/2010/09/21/1832364.html #include <stdio.h> #include <list> #include <string.h> using namespace std; int main() { ],b[],i,j; while(…
题意: 在x,y坐标范围为10 ^ -9 ~~ 10 ^ 9的坐标轴之中,有 10W个点(注意有些点可能在同一坐标上),然后有10W个询问,处理询问按照输入顺序处理,对于每个询问a,b    a == 0 代表对 x == b轴处理: a == 1 代表 对y == b轴处理.处理即为把该轴上的点全部清空,输出清空的点的数量.已经清空的点,不计算在接下来的询问中. 思路:map + multiset 对于x轴和y轴,分别用两个map 映射,每一个x(或者y)轴都对应着一排点,这些点用multis…
Bombing Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 2650    Accepted Submission(s): 990 Problem Description It’s a cruel war which killed millions of people and ruined series of cities. In o…
Hints of sd0061 Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2421    Accepted Submission(s): 736 Problem Description sd0061, the legend of Beihang University ACM-ICPC Team, retired last yea…