- 博客(9)
- 资源 (8)
- 收藏
- 关注
原创 Sicily 3394 Pair
一道很有趣的题目,可以用类似拓扑排序的思想,先把入度为一的点入队,每次pop出2个,并且把图中所有指向第二个点的边删掉.也可以用匈牙利算法.#include #include #include #include #include #include using namespace std;#define FILL(x) memset(x, 0, sizeof
2013-09-10 18:13:21 439
原创 Sicily 1193 Up the Stairs
http://soj.me/1193模拟水题卡好久..这种题目看别人代码真心不如自己想啊囧#include #include #include using namespace std;const int MAXN= 1100;int main(){ int T; scanf("%d", &T); while(T--) {
2013-06-17 01:36:19 657
原创 漂亮的匈牙利算法
http://www.byvoid.com/blog/hungary/回忆了一下图论知识,用byvoid大牛的例子自己算了一下才明白..如果还没有明白,就看这个 http://www.matrix67.com/blog/archives/39ps 元学习就是比看图论书快啊..真的很漂亮啊,简单粗暴美丽poj 1274#include#include#incl
2013-06-08 10:27:35 519
原创 Sicily 1050 Numbers & Letters
注意减法和除法可交换,除法判断`div`0//#define LOCAL#define DEBUG#include #include #include #include #include #include #include #include #include #include #include #include #include #include #i
2013-06-04 15:43:41 613
原创 USACO 3.3.3 Camelot
这是传说中的镇站神题么.. orz了前前后后大概写了30k的代码,调了10+h才过...如果一开始就想清楚,只要调好2个typo,几个特判就好了,不用2个小时,所以写之前一定要想清楚细节...首先用个四维数组保存任意点到任意点的距离,然后穷举集结点计算普通的骑士距离和,同时找出最短的先去载王再到集结点的距离。一个优化是假设王自己的移动范围只有+-2.同时要注意没有骑士和有骑
2013-06-01 12:37:27 536 1
原创 金明的预算方案 有限制的背包问题
第一次写有限制的背包,深切地感觉到与高中生之间的差距 stQ#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #inc
2013-04-24 00:42:54 575
原创 Sicily 1902 Counting Problem 简洁dp
// Problem#: 5003// Submission#: 2053786// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by
2013-04-22 15:08:40 527
原创 Follow your heart, though its infinitely recursive
想做很多很多事情,想做算法,想读math,想做编程研究,想学好scheme, haskell, 想继续学习python, ruby, 想尝试下archlinux, vim, emacs下每一个save your life的配置,想读完kindle中所有的书,想用web.py写个简单美丽的博客...所以,把todos分成一个个简单清晰的单体,按重要程度排序,然后follow your heart
2013-03-19 22:08:52 652
Graph Theory With Applications - J. Bondy, U. Murty
2013-03-26
The Art of Computer Programming knuthE文pdf
2007-12-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人