码迷,mamicode.com
首页 >  
搜索关键字:poj 3348 cows    ( 21218个结果
【POJ】3468 A Simple Problem with Integers
线段树。段区间,终于完全自己A掉的。 1 #include 2 #include 3 4 #define MAXN 100005 5 #define lson l, mid, rt>1);20 sums[rt>1));21 adds[rt] = 0;22 ...
分类:其他好文   时间:2014-06-06 23:32:27    阅读次数:279
poj 1469 COURSES (二分匹配)
COURSESTime Limit:1000MSMemory Limit:10000KTotal Submissions:16877Accepted:6627DescriptionConsider a group of N students and P courses. Each student v...
分类:其他好文   时间:2014-06-06 23:22:36    阅读次数:191
poj 1422 Air Raid (二分匹配)
Air RaidTime Limit:1000MSMemory Limit:10000KTotal Submissions:6520Accepted:3877DescriptionConsider a town where all the streets are one-way and each s...
分类:其他好文   时间:2014-06-06 23:19:59    阅读次数:319
poj 1274 The Perfect Stall (二分匹配)
The Perfect StallTime Limit:1000MSMemory Limit:10000KTotal Submissions:17768Accepted:8104DescriptionFarmer John completed his new barn just last week,...
分类:其他好文   时间:2014-06-06 23:15:27    阅读次数:273
POJ 2960
也算是一道模板题吧,只需按照SG函数的定义求出每个值的SG,然后异或就可以了。 1 #include 2 #include 3 #include 4 5 using namespace std; 6 const int N=10005; 7 int sg[N]; 8 bool vis[N];...
分类:其他好文   时间:2014-06-04 17:27:21    阅读次数:200
POJ 2068
就是必胜点与必败点的计算而已。计算每一种情况。设st[i][j]为在第i个人剩下j个石头时的情况,拿它转移后的情况比较。可以到达必败点,则当前为必胜点。若只能到达必胜点,则当前点为必败点。 1 #include 2 #include 3 using namespace std; 4 const .....
分类:其他好文   时间:2014-06-04 17:05:36    阅读次数:190
POJ 2608
1 #include 2 #include 3 #include 4 using namespace std; 5 int a[30]={-1,1,2,3,-1,1,2,-1,-1,2,2,4,5,5,-1,1,2,6,2,3,-1,1,-1,2,-1,2}; 6 char s[25]; i...
分类:其他好文   时间:2014-06-04 17:03:39    阅读次数:195
poj 1699 Best Sequence
http://poj.org/problem?id=1699题意:给你n个长度为L的序列,求包含这几个序列的最短长度。先预处理每两个序列之间的关系,然后dfs枚举就行。 1 #include 2 #include 3 #include 4 #define maxn 500 5 using na...
分类:其他好文   时间:2014-06-04 16:34:14    阅读次数:255
poj3080解题报告(暴力、最大公共子串)
POJ3080,题目链接http://poj.org/problem?id=3080题意:就是求m个长度为60的字符串的最长连续公共子串,2=3的所有连续子串找出来,然后由短到长查看所有主串是否有该子串。2.如果发现一个公共子串,那么就开始找长度+1的公共子串;如果指定长度的所有子串都找不出一条是共...
分类:其他好文   时间:2014-06-04 16:30:49    阅读次数:246
poj3311 经典tsp问题
TSP问题目前有多种解法:搜索解法,动归解法,启发式解法。这里就针对poj 3311问题给出了前两种解法。 搜索解法:这种解法其实就是计算排列子集树的过程。从0点出发,要求遍历1,2,3点后回到0点。以不同的顺序来依次遍历1,2,3点就会导出不同的路径(0->1->2->3->0;0->1->3->2->0等等),总共有3!=6条路径需要考虑,从中选出最短的那条就是所求。搜索解法的时间复杂度为O(n!)。 动归解法:仔细观察搜索解法的过程,其实是有很多重复计算的。比如从0点出发,经过1,2,3,4,5点后回...
分类:其他好文   时间:2014-06-02 19:02:01    阅读次数:436
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!