上一页 1 2 3 4 5 6 ··· 27 下一页
摘要: 很早就知道下载资源好多都会提供校验值,但直到前几天看了一篇网文,才对这个的必要性有了深刻理解。 网文的链接是http://blog.eqoe.cn/posts/thunder-download-file-spoof.html,下面粘一段原文来以免以后原地址打不开 对迅雷下载进行投毒的简单尝试 示例: 阅读全文
posted @ 2016-02-27 22:36 moonbay 阅读(374) 评论(0) 推荐(1) 编辑
摘要: 其实还是经常写二分的,也知道二分查找有好多写法,然而一直没有总结一下。现单独开一篇备忘。我通常的二分写法是:int binarysearch(int *a, int n, int d) { int left = 0, right = n - 1; while (left d) { ... 阅读全文
posted @ 2015-10-17 02:06 moonbay 阅读(823) 评论(2) 推荐(0) 编辑
摘要: 题意特难懂,我看了好多遍,最后还是看讨论版里别人的问答,才搞明白题意,真是汗。其实题目等价于给n个点,这n个点均匀分布在一个圆上(知道圆半径),点与点之间的路程(弧长)已知,点是有权值的,已知,点与点的距离等于其最短路程(弧长)加上两点的权值,问距离最远的两个点的下标。因为是环状,不好处理,所以我在... 阅读全文
posted @ 2015-06-06 22:39 moonbay 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 百度之星复赛第一题。不明白这么水的题为何一堆人没过。。。这些人是咋晋级复赛的呢。。。/* * Author : ben */#include #include #include #include #include #include #include #include #include #inc... 阅读全文
posted @ 2015-06-06 20:59 moonbay 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 挺简单的动态规划题。我用记忆化搜索打的。直接上代码:/* * Author : ben */#include #include #include #include #include #include #include #include #include #include #include #i... 阅读全文
posted @ 2015-06-05 21:47 moonbay 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 给一个数列,问最少修改多少个元素使数列严格递增。如果不是要求“严格”递增,那就是求最长不降子序列LIS,然后n-LIS就是答案。要严格递增也好办,输入的时候用每个数减去其下标处理一下就行了。/* * Author : ben */#include #include #include #incl... 阅读全文
posted @ 2015-05-31 19:29 moonbay 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 纯暴力就能过的,可是题目描述真心不清楚,我看了好久好久才明白题目啥意思。为了迅速打完,代码比较冗余。/* * Author : ben */#include #include #include #include #include #include #include #include #incl... 阅读全文
posted @ 2015-05-31 19:25 moonbay 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 赤裸裸最小生成树,没啥说的,我用kruskal过的/* * Author : ben */#include #include #include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2015-05-31 19:22 moonbay 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 百度之星的题。其实最简单的方法是二分答案,我竟然没想到,直接去想O(n)的去了,最后导致滚粗。。。题意就是给一个数列,要求把它处理成递增序列。首先我想到了O(n^2)的算法,然后再优化成O(n)过的。n^2的做法是,弄一个尾指针e,从后往前扫,一旦发现a[e-1]>=a[e],说明a[e]之后的所有... 阅读全文
posted @ 2015-05-30 21:05 moonbay 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 题目超简单,我写解题报告是因为我的代码用了些STL,使代码很简洁。* * Author : ben */#include #include #include #include #include #include #include #include #include #include #incl... 阅读全文
posted @ 2015-03-27 01:51 moonbay 阅读(147) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 27 下一页