这两天学习了网络流,下面是ISAP算法模板:
const int inf = 0x3fffffff;
template
struct Isap
{
int top;
int d[N], pre[N], cur[N], gap[N];
struct Vertex{
int head;
} V[N];
struct Edge{...
分类:
其他好文 时间:
2014-05-26 04:10:16
阅读次数:
252
1、C++编成求二叉树的深度;int binTreeDepth(link *head){ int
depthl=0,depthr=0; if(head==null) return 0; else{ if ((head->left)!=null)
depthl = 1 + binTreeDepth(h...
分类:
其他好文 时间:
2014-05-26 02:48:07
阅读次数:
266
缓存算法(页面置换算法)-FIFO、LFU、LRU
在前一篇文章中通过leetcode的一道题目了解了LRU算法的具体设计思路,下面继续来探讨一下另外两种常见的Cache算法:FIFO、LFU1.FIFO算法
FIFO(First in First out),先进先出。其实在操作系统的设计理念中.....
分类:
其他好文 时间:
2014-05-26 02:47:04
阅读次数:
605
题目:The sum of the squares of the first ten
natural numbers is,12 + 22 + ... + 102 = 385The square of the sum of the first
ten natural numbers is,(1 + ...
分类:
其他好文 时间:
2014-05-26 02:15:16
阅读次数:
216
网络应用程序,分为前端和后端两个部分。当前的发展趋势,就是前端设备层出不穷(手机、平板、桌面电脑、其他专用设备......)。
因此,必须有一种统一的机制,方便不同的前端设备与后端进行通信。这导致 API 构架的流行,甚至出现"API First"的设计思想。RESTful
API是目前比较成熟.....
开发过web
app的同学,特别是前端人员,都碰到这烦人的事情,JS或CSS代码改变,可手机浏览器怎么刷新都不更新,手机浏览器的缓存特别恶劣。所以今天贴个方法解决这问题。记得,本地调试的时候贴上,上线后要删除哦,免得访问者浏览体验慢。代码: 把上面的代码贴到HEAD里面即可。顺便贴个缓存的资料:1....
分类:
移动开发 时间:
2014-05-26 01:33:35
阅读次数:
296
jQuery的serialize()方法通过序列化表单值,创建URL编码文本字符串,我们就可以选择一个或多个表单元素,也可以直接选择form将其序列化,如:First
name: Last name: $(document).ready(function(){ console.log($("f...
分类:
Web程序 时间:
2014-05-25 23:37:11
阅读次数:
388
Problem Description
Teacher HU and his 40 students were trapped by the brigands. To show their power, the head of the brigands want to select one people to kill.
Teacher HU and his 40 students wil...
分类:
其他好文 时间:
2014-05-25 18:19:44
阅读次数:
306
Problem Description
Teacher HU and his 40 students were trapped by the brigands. To show their power, the head of the brigands want to select one people to kill.
Teacher HU and his 40 students wil...
分类:
其他好文 时间:
2014-05-25 10:02:35
阅读次数:
309
题目来源:UVa 10294 Arif in Dhaka (First Love Part 2)
题意:n颗珠子t种颜色 求有多少种项链和手镯 项链不可以翻转 手镯可以翻转
思路:Polya定理 题目就是求等价类 项链只能旋转 手镯可以旋转也可以翻转
根据定理 等价类的数量等于各个置换f的t^m(f)的平均数 m(f)是置换的循环节数 下面每次t^x x都是循环节数
下面考虑手镯 旋转翻...
分类:
其他好文 时间:
2014-05-24 19:52:10
阅读次数:
258