hdu 5199 Gunner】的更多相关文章

原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5199 简单题,stl水之... #include<algorithm> #include<iostream> #include<cstdlib> #include<cstring> #include<cstdio> #include<set> #include<map> using std::map; map<int,…
Problem Description Long long ago, there is a gunner whose name is Jack. He likes to go hunting very much. One day he go to the grove. There are n birds and n trees. The i−thbird stands on the top of the i−th tree. The trees stand in straight line fr…
Gunner Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5199 Description Long long ago, there is a gunner whose name is Jack. He likes to go hunting very much. One day he go to the grove. There are n birds and n…
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5233 简单题,stl水之... #include<algorithm> #include<iostream> #include<cstdlib> #include<cstdio> #include<set> using std::multiset; struct Node { int val, pos; Node(, ) :val(_val), po…
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5233 bc(中文):http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=585&pid=1002 题解: 离散化之后,存在一张表里面(相同的值的id号用链表串起来,倒着存),每次查询完就把表首的删了,继续查. 之前离散的时候没有把查询的一起加进去,就一直t,估计是查询的时候很多是没有结果的,就会比较耗时间.…
题目传送门 /* 题意:问值为x的个数有几个,第二次查询就是0 lower/upper_bound ()函数的使用,map也可过,hash方法不会 */ #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #include <iostream> #include <vector> #include <set> #include…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5199 题目意思:给出鸟在树上的高度,以及射击到的高度,问每次射击能射中鸟的数量 用 vector 里面的 lower_bound() 函数求出大于等于某个 x  的下标,upper_bound() 求出大于某个 x 的下标,然后相减就是射中的数量了.vis[] 数组是防止再次击中相同高度的,明显是 0 嘛~~~. 因为是 huge input ,用到 get_int() 来加快输入(不过貌似没啥用…
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=5199 先对树的高度排序,然后对每次射击高度二分查找即可,打过之后数目变为0. #include<cstdio> #include<iostream> #include<string.h> #include<algorithm> #include<math.h> #include<stdbool.h> #include<time.h&…
Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7194    Accepted Submission(s): 3345 Problem Description 话说上回讲到海东集团面临内外交困,公司的元老也只剩下XHD夫妇二人了.显然,作为多年拼搏的商人,XHD不会坐以待毙的.  一天,当他正在苦思冥想解困良策的…
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; int jc[100003]; int p; int ipow(int x, int b) { ll t = 1, w = x;…