摘要: poj3468 A Simple Problem with Integers( m - ( m >> 1 ) )这里跪了几发。。 - 的优先级大于 >> 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #incl... 阅读全文
posted @ 2014-08-13 22:42 L__J 阅读(355) 评论(0) 推荐(0) 编辑
摘要: hdu2795 Billboard 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 using namespace std;11 12 #define mnx 2... 阅读全文
posted @ 2014-08-13 11:50 L__J 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 被虐了一下午。。离散化,开一个rr[mnx], cc[mnx],初始化为rr[i] = i, cc[i],然后换的时候就换这两个数组就好了。。然后就是不断的lower_bound 1 #include 2 #include 3 #include 4 #include 5 #include 6 #in... 阅读全文
posted @ 2014-08-12 21:21 L__J 阅读(202) 评论(0) 推荐(0) 编辑
摘要: CircleDescriptionYou are given n points and two circles. The radius of the circle will be dynamical. Your task is to find how many points are under bo... 阅读全文
posted @ 2014-08-11 23:54 L__J 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 第一题太水了。。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int a[6]; 7 int main(){ 8 int cas; 9 scanf( "%d", &cas );10 ... 阅读全文
posted @ 2014-08-11 20:41 L__J 阅读(208) 评论(0) 推荐(0) 编辑
摘要: A题逗比了,没有看到Allaiare distinct. Allbiare distinct. 其实很水的。。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define mnx 100002... 阅读全文
posted @ 2014-08-11 15:03 L__J 阅读(693) 评论(0) 推荐(0) 编辑
摘要: 对task和machine的yi由小到大进行排序,然后对machine来跟task配对。当machine[].yi >= task[].yi时,就更新线段树,在1-1440上做线段树,线段树存的是task[].xi,同时用用优先队列保存task[].yi;当machine[].yi 2 #incl... 阅读全文
posted @ 2014-07-23 15:09 L__J 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 基本思想是贪心。对于价值c=500*xi+2*yi,yi最大影响100*2 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 using namespace std;11 12 #def... 阅读全文
posted @ 2014-07-23 14:05 L__J 阅读(241) 评论(0) 推荐(0) 编辑
摘要: A - Rewards 1 #include 2 #include 3 using namespace std; 4 int main(){ 5 int a[3], b[3], sum1 = 0, sum2 = 0; 6 int n; 7 for( int i = 0; i ... 阅读全文
posted @ 2014-07-23 11:55 L__J 阅读(169) 评论(0) 推荐(0) 编辑
摘要: hdu4857逃生第一题是拓扑排序,不是按照字典序最小输出,而是要使较小的数排在最前面。。赛后弄了好久,才比较明白,我一直以为反向建图,i从1到n,开始深搜dfs( i ),对i点的边,由小到大继续搜一下,同时标记搜过的数,搜过之后就不再搜,搜到底之后ans[cnt++] = u;这样顺序输出就是答... 阅读全文
posted @ 2014-07-22 02:33 L__J 阅读(261) 评论(2) 推荐(0) 编辑