摘要: 我感觉二维树状数组和而为线段树的思想差不多,都是在原来的基础上加了一个新的树状数组或者是线段树,代码量也不是那么的大。 然后我想找一个图的,但是在百度上面也没有找到什么好点的图,因为一维树状数组解决的是一个区间的和,那么我们每个数下面再加上一个树状数组, 那么我们解决的就是一个矩形区域的所有的数的和 阅读全文
posted @ 2017-03-11 17:03 Heilce 阅读(230) 评论(0) 推荐(0) 编辑
摘要: Problem Description There are n men ,every man has an ID(1..n).their ID is unique. Whose ID is i and i-1 are friends, Whose ID is i and i+1 are friend 阅读全文
posted @ 2017-03-11 16:21 Heilce 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Innokenty is a president of a new football league in Byteland. The first task he should do is to assign short names to all clubs to be shown on TV nex 阅读全文
posted @ 2017-03-06 18:56 Heilce 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 1100 - 萌萌哒的第五题 Time Limit:10s Memory Limit:128MByte Submissions:353Solved:76 1100 - 萌萌哒的第五题 Time Limit:10s Memory Limit:128MByte Submissions:353Solved 阅读全文
posted @ 2017-03-06 12:31 Heilce 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 这个问题就是简单的Lucas定理的基础的问题,但是还是应该自己写一下的。 因为FZU现在不能提交所以说我也不知道对不对,但是感觉应该是对的。 DP? Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 128000/128000 K (Java 阅读全文
posted @ 2017-03-04 15:42 Heilce 阅读(162) 评论(0) 推荐(0) 编辑
摘要: LL quick_mod(LL a, LL b) { LL ans = 1; a %= p; while(b) { if(b & 1) { ans = ans * a % p; b--; } b >>= 1; ... 阅读全文
posted @ 2017-03-04 15:33 Heilce 阅读(110) 评论(0) 推荐(0) 编辑
摘要: n个人,每个人ci的金币,每天最富有的人都会给最贫穷的人1金币,问k天后最富有人和最贫穷的人差了多少金币。 数据 1 <= n <= 5e5, 0 <= k <= 1e9, 1 <= ci <= 1e9。 输入 4 1 1 1 4 2 3 1 2 2 2 输出 2 0 说明 对于样例1, [1,1, 阅读全文
posted @ 2017-03-04 11:55 Heilce 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 第一次感觉vector有很多的用法,我们可以在vector里面进行删除和修改操作,复杂度都是log(n)还有就是lower_bound()和upper_bound() 加上这些的东西,感觉stl解决的问题就是更多了。 lower_bound(): 在first和last的前闭后开区间进行二分查找,返 阅读全文
posted @ 2017-03-03 21:34 Heilce 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Of course you have heard the famous task about Hanoi Towers, but did you know that there is a special factory producing the rings for this wonderful g 阅读全文
posted @ 2017-02-28 19:39 Heilce 阅读(539) 评论(0) 推荐(0) 编辑
摘要: Moriarty has trapped n people in n distinct rooms in a hotel. Some rooms are locked, others are unlocked. But, there is a condition that the people in 阅读全文
posted @ 2017-02-27 21:29 Heilce 阅读(356) 评论(0) 推荐(0) 编辑