Ikki's Story IV - Panda's Trick Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 10238 Accepted: 3762 Description liympanda, one of Ikki’s ...
分类:
其他好文 时间:
2017-08-06 17:07:41
阅读次数:
180
What is Port Triggering? If you have not read my explanation of port forwarding do so now. You can find it here. Port triggering is pretty simple once ...
分类:
其他好文 时间:
2017-08-02 10:08:15
阅读次数:
234
Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID ...
分类:
其他好文 时间:
2017-07-20 22:32:44
阅读次数:
168
https://leetcode.com/problems/maximum-average-subarray-i/#/description 求指定长度为 k 的子数组的最大均值,基本思路是用长度为k 的滑动窗口扫一遍原数组,然后记录最大子数组的MaxSum,最后返回MaxSum/k 可以优化的部分 ...
分类:
其他好文 时间:
2017-07-20 15:22:14
阅读次数:
160
原版: https://stackoverflow.com/questions/7414794/difference-between-contextannotation-config-vs-contextcomponent-scan/ 翻译版: http://www.cnblogs.com/leiO ...
分类:
编程语言 时间:
2017-07-11 23:00:07
阅读次数:
252
说到素数不得不说素数判定算法。 其中极为经典的为Rabin Miller测试。 通过二次探测的方法,我们可以将其正确率上升到一个很高的高度。 二次探测的原理我还是不太懂,所以NOI前我暂时只是梳理一下这个算法的流程。 首先,我来介绍一些小Trick。 $O(1)$的快速乘。 在一些卡常数而且爆lon ...
分类:
其他好文 时间:
2017-07-10 16:28:08
阅读次数:
228
无序数组返回两个元素和为给定值的下标。 tricks:无序、返回下标增序、返回的是原始数组的下标。 vector<int>*pa; bool cmp(int x,int y){ return (*pa)[x]<(*pa)[y]; } class Solution { public: vector<i ...
分类:
其他好文 时间:
2017-07-09 13:54:48
阅读次数:
144
传送门:https://www.luogu.org/problem/show?pid=3613 【题解】 按二进制位分开,对于每一位,用“起床困难综合征”的方法贪心做。 写棵LCT,维护正反两种权值,每个维护2种,代表全0的输出和全1的输出。 然后直接上LCT即可。 权值的合并有点trick,可以参 ...
分类:
其他好文 时间:
2017-07-08 00:20:58
阅读次数:
200
题目见这里 (分析) 分四步进行: 1)根据给定的结点情况建二叉树 2)对输入的键值排序(asending) 3)对二叉树中序遍历,同时对应赋key值 4)层次遍历(队列应用) 题目并不困难,但是我误入了trick,错误假定了结点按先序遍历是按顺序编号的(当然是受样例的影响),所以有了下面22分(满 ...
分类:
其他好文 时间:
2017-07-08 00:19:46
阅读次数:
260
这两题有一个 trick 和 Minimum Window Substring 非常像,就是维护一个 "curCount" 代表目前 (i,j) 之间 match 上的数量,而通过 hash[] 的正负充当计数器的作用 ...
分类:
其他好文 时间:
2017-07-05 22:56:46
阅读次数:
170