nicholas

nicholas

2008年11月19日

SRM 424 div1 900 ProductOfPrices 翻译

摘要: 为了解决这样的问题,我们需要关于一个整型数组A[1..N]的数据结构,它支持这样的操作,起初,数组中的元素都是0,而且这样的数据结构支持下面两种操作: 1.更新A[pos] = A[pos] + value (其中value,pos是任意给定的,且可能为负值) 2.计算sum(A, l, r) = A[l]+A[l+1]+A[l+2]+...+A[r-1]+A[r](其中l, r是任意给定... 阅读全文

posted @ 2008-11-19 16:00 zy_nic 阅读(407) 评论(0) 推荐(0)

2008年11月12日

..

摘要: Code Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->#include #include using namespace std; const int maxn = 310; const int maxe = 2048; const ... 阅读全文

posted @ 2008-11-12 20:07 zy_nic 阅读(206) 评论(0) 推荐(0)

2008年10月22日

emacs的c++mode

摘要: C/C++ 模式 指定为C++模式的方法:一般根据扩展名自动设定,不用指定,不过有时候你希望.h文件是C++模式的(缺省是C模式), 在文件第一行(或其末尾)上加入 // -- C++ -- 语法高亮:不是C模式专有,顺便提一下,M-x global-font-lock-mode RET 或在.emacs中加入(global-font-lock-mode t)。 在console下,Emacs... 阅读全文

posted @ 2008-10-22 16:50 zy_nic 阅读(1678) 评论(0) 推荐(0)
contest

摘要: ural Schedule 25 October 2008.Autumn school contest 2008 1 November 2008.NEERC 2008, Eastern subregion quarterfinals Also look at the contes... 阅读全文

posted @ 2008-10-22 11:38 zy_nic 阅读(245) 评论(0) 推荐(0)
contest

摘要: ural Schedule 25 October 2008.Autumn school contest 2008 1 November 2008.NEERC 2008, Eastern subregion quarterfinals Also look at the contes... 阅读全文

posted @ 2008-10-22 09:05 zy_nic 阅读(177) 评论(0) 推荐(0)

2008年9月18日

我的2-sat模板

摘要: Code Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->/* 建立图2*i,2*i+1是两个对立的 结果中如果color[j]=RED表示取该点 */ #include #include usingnamespacestd; ... 阅读全文

posted @ 2008-09-18 00:11 zy_nic 阅读(493) 评论(0) 推荐(0)

2008年9月15日

Solution to GCJ Practice Contest Problem C, Cycles

摘要: GCJ Practice Contest Problem C: In this problem, u r asked to calculate the number of all the Hamiltonian Circles in complete graph only with at most 15 forbidden edges. We know, finding the Hamilto... 阅读全文

posted @ 2008-09-15 22:31 zy_nic 阅读(235) 评论(0) 推荐(0)

2008年9月11日

约瑟夫问题的数学方法

摘要: 约瑟夫问题的数学方法 无论是用链表实现还是用数组实现都有一个共同点:要模拟整个游戏过程,不仅程序写起来比较烦,而且时间复杂 度高达O(nm),当n,m非常大(例如上百万,上千万)的时候,几乎是没有办法在短时间内出结果的。 为了讨论方便,先把问题稍微改变一下,并不影响原意: 问题描述:n个人(编号0~(n-1)),从0开始报数,报到(m-1)的退出,剩下的人继续从0开始报数。求胜利者的编号 。... 阅读全文

posted @ 2008-09-11 22:44 zy_nic 阅读(1449) 评论(0) 推荐(1)

2008年5月17日

我的模板

摘要: $BEGINCUT$ $PROBLEMDESC$ $ENDCUT$ #line $NEXTLINENUMBER$ "$FILENAME$" #include #include #include #include #include #include #include #include #include #include #include #include #inclu... 阅读全文

posted @ 2008-05-17 16:32 zy_nic 阅读(318) 评论(0) 推荐(0)

2007年10月21日

图的应用

摘要: 广度优先周游 poj 1376 深度优先周游 poj 1164 广度优先搜索 poj 2049 这就是今天做的,2049在用stl的时候出了点岔子,以至于一直re 就是 vector > g 在clear()的时候要注意啥啥的 还没搞明白 忙看书 阅读全文

posted @ 2007-10-21 20:06 zy_nic 阅读(264) 评论(0) 推荐(0)