01 2015 档案
摘要:http://poj.org/problem?id=1739题意:n×m的棋盘,'#'是障碍,'.'是空白,求左下角走到右下角且走过所有空白格子的方案数。(n,m#include #include using namespace std;typedef long long ll;#define BI...
阅读全文
摘要:http://poj.org/problem?id=3133题意:n×m的网格,有2个2,2个3,他们不会重合。还有障碍1。现在求2到2的路径和3到3的路径互不相交的最短长度-2。(2#include #include using namespace std;struct H { static co...
阅读全文
摘要:http://acm.fzu.edu.cn/problem.php?pid=1977题意:n×m的网格,有3种格子,'O'必须经过、'*'可以选择经过、'X'不能经过。现在要求路径经过所有'O'且是简单回路的数量#include #include #include using namespace s...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1693题意:n×m的棋盘求简单回路(可以多条)覆盖整个棋盘的方案,障碍格不许摆放。(n,m#include #include using namespace std;typedef long long ll;str...
阅读全文
摘要:http://acm.timus.ru/problem.aspx?space=1&num=1519题意:给一个n×m的棋盘,其中'.'是空白,'*'是障碍,求经过所有点的哈密顿回路的数目。(n,musing namespace std;typedef long long ll;#define BIT...
阅读全文
摘要:开一个新坑......(听说tc是智商高的人才能玩的QAQ显然我是被屠的...1【645DIV2】这个能说是裸模拟吗...弃坑= =做了一些题感觉没必要放上来了= =等div1先吧...................(tc客户端太慢辣!
阅读全文
摘要:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2245题意:求用1×2的棋子摆满n×m的棋盘的方案数。(n×musing namespace std;lon...
阅读全文
摘要:http://poj.org/problem?id=2406题意:给定一个字符串 L,已知这个字符串是由某个字符串 S 重复 R 次而得到的,求 R 的最大值。(长度#include #include #include #include using namespace std;int p[20000...
阅读全文
摘要:http://www.spoj.com/problems/DISUBSTR/题意:求字符串不同子串的数目。#include using namespace std;const int N=1005;void sort(int *x, int *y, int *sa, int n, int m) { ...
阅读全文
摘要:http://poj.org/problem?id=3261题意:一个长度为n的串,要求最长的子串的长度且这个子串的出现次数不少于k次。(1#include using namespace std;const int N=20015;void sort(int *x, int *y, int *sa...
阅读全文
摘要:http://poj.org/problem?id=1743题意:不可重叠最长重复子串,n#include using namespace std;const int N=20015;void sort(int *x, int *y, int *sa, int n, int m) { static ...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2946题意:给n个串,求最大公共子串。(1using namespace std;const int N=2005<<1;struct sam { int cnt, root, last, l[N], ...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1854题意:n个数据,每个数据有两个属性,要求取一些数据且每个数据取一个属性使得组成连续的一段单调递增的数(从1开始),求最大能连续到多少。(nusing namespace std;const int...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1452题意:n×m的矩阵上每个点有个颜色,现在有q个操作:1 x y c 将点(x,y)的颜色改为c;2 x1 x2 y1 y2 c 询问矩阵x1y1-x2y2颜色为c的格子数目#include usi...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1103题意:一棵n节点的树(1using namespace std;const int N=250005;int n, ihead[N], cnt;struct dat { int next, to;...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3319题意:给一棵n节点的树(n#include #include #include #include #include #include #include #include #include usin...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1019题意:汉诺塔规则,只不过盘子n#include #include #include #include #include #include #include #include #include us...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3850题意:类似国王游戏....无意义..#include #include #include #include #include #include #include #include #include...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1074题意:一开始有一个左上角是(0,100),右下角是(100,0)的纸片,现在可以沿有向直线折n次(n#include #include #include #include #include #in...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1048题意:给出一个a×b(a,b#include #include #include #include #include #include #include #include #include usi...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3809题意:n个元素(1#include #include #include #include #include #include #include #include #include using na...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1018题意:有2行,每行有c(c#include #include #include #include #include #include #include #include using namespa...
阅读全文
摘要:http://poj.org/problem?id=1279题意:给一个n个点的多边形,n#include #include #include #include #include #include #include #include using namespace std;typedef long ...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1038题意:给出n个x轴各不相同的二维整点,且升序,n#include #include #include #include #include #include #include #include #i...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2178题意:给出n#include #include #include #include #include #include #include #include #include using names...
阅读全文
摘要:http://uoj.ac/contest/6/problem/51题意:给m(m≤105)个询问,每次给出a,b(ab≤n,n≤109),对于每一组a,b,双人博弈,每次可以给a加1或给b加1,要求每次操作后ab≤n。不能操作的...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1027题意:n种材料,m种需求。每种材料有三个属性,给出三个属性的含量(和为1),问能否通过这n种材料合成m种需求的材料。(n,m≤500)#include #includ...
阅读全文
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1043唯一让我不会的就是怎么求圆的周长并QAAQ...然后发现好神!我们可以将圆弧变成[0,2π]的直线!然后一定要注意!起点是(1,0)(单位圆)首先学了余弦定理...在三角形AB...
阅读全文
摘要:http://poj.org/problem?id=1151经典矩形面积并吧.....很简单我就不说了...有个很神的地方,我脑残没想到:将线段变成点啊QAQ这样方便计算了啊还有个很坑的地方,为毛每一次我精确地计算过空间可就是wa....一改大就ac...我无力了..#include #includ...
阅读全文
摘要:http://poj.org/problem?id=1228随便看看就能发现,凸包上的每条边必须满足,有相邻的边和它斜率相同(即共线或凸包上每个点必须一定在三点共线上)然后愉快敲完凸包+斜率判定,交上去wa了QAQ。原因是忘记特判一个地方....因为我们求的凸包是三点共线的凸包,在凸包算法中我们叉积...
阅读全文
摘要:http://poj.org/problem?id=1556首先路径的每条线段一定是端点之间的连线。证明?这是个坑...反正我是随便画了一下图然后就写了..然后re是什么节奏?我记得我开够了啊...然后再开大点才a...好囧啊.#include #include #include #include ...
阅读全文
摘要:http://poj.org/problem?id=1113答案是凸包周长+半径为l的圆的周长...证明?这是个坑..#include #include #include #include #include #include #include #include #include using name...
阅读全文
摘要:http://poj.org/problem?id=2318第一次完全是O(n2)的暴力为什么被卡了~QAQ(一定是常数太大了...)后来排序了下点然后单调搞了搞。。(然而还是可以随便造出让我的code变成O(n2)的23333)#include #include #include #i...
阅读全文
摘要:http://poj.org/problem?id=2653我很好奇为什么这样O(n2)的暴力能过....虽然说这是加了链表优化的,但是最坏不也是O(n2)吗。。。(只能说数据太弱...)然后本题裸的判线段相交和点在直线上...(看了网上的标程,不判端点的情况都能过我也是醉了...)#i...
阅读全文
摘要:http://poj.org/problem?id=1269我会说这种水题我手推公式+码代码用了1.5h?还好新的一年里1A了~~~~#include #include #include #include #include #include #include #include #include us...
阅读全文