码迷,mamicode.com
首页 >  
搜索关键字:poj 1979    ( 20310个结果
poj--2676--回溯
很久很久前 就做过数独了 当时一直没做出来了这次 也磕磕绊绊 终于过了.... 数独题 真的很好 对于回溯的理解 很有帮助一下子 觉得 全垒打的节奏... touch me 1 #include 2 #include 3 using namespace std; 4 5...
分类:其他好文   时间:2014-07-18 14:36:23    阅读次数:169
POJ 1679
求一次最小成树,求一次小生成树,若相等,则不唯一。否则,唯一。 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 const int MAXN=105; 8 const int inf=100000...
分类:其他好文   时间:2014-07-18 14:30:37    阅读次数:264
POJ 1243
#include#include#include#includestruct rank{char name[12];int sol, tot, g, p[7], ind;//sol 解决题数 tot总时间};rank r[25];int comp(const void *c, const void ...
分类:其他好文   时间:2014-07-18 10:29:36    阅读次数:188
POJ 1458 最长公共子序列
子序列就是子序列中的元素是母序列的子集,且子序列中元素的相对顺序和母序列相同。题目要求便是寻找两个字符串的最长公共子序列。dp[i][j]表示字符串s1左i个字符和s2左j个字符的公共子序列的最大长度。注意s1第i个字符为s1[i-1]于是有递推公式:对于abcfbc和abfcab两个字符串,求公共...
分类:其他好文   时间:2014-07-18 10:23:55    阅读次数:272
poj 1129 Channel Allocation
可以转化为着色模型dfs + 四色定理 1 #include 2 #include 3 int n,num; 4 int d[100][100]; 5 int c[100]; 6 7 bool ok(int step) 8 { 9 for(int i = 0; i = n) return ...
分类:其他好文   时间:2014-07-18 10:18:34    阅读次数:239
POJ - 3126 Prime Path
BFS,最好先打个质数表。 1 #include 2 #include 3 #include 4 #include 5 //#include 6 const int maxn=15000+5; 7 int s[10]; 8 int vis[maxn],isp[maxn]; 9 us...
分类:其他好文   时间:2014-07-18 09:29:37    阅读次数:231
POJ - 3624 Charm Bracelet
01背包,DP简答题就行,要用滚动数组,不然内存要爆。for循环的方向很重要,虽然是简单题,但对理解DP帮助很大,听队长说要把每一个状态写出来,我试着写了一下,果然更容易理解了。 1 #include 2 #include 3 #define doumax(a,b) (a>b?a:b) 4 cons...
分类:其他好文   时间:2014-07-18 09:23:32    阅读次数:181
POJ - 1915 Knight Moves
BFS结合队列#include#include#includeusing namespace std;int x,y,l;const int maxn=300+5;int visit[maxn][maxn];struct node{ int xpos; int ypos; int ...
分类:其他好文   时间:2014-07-18 00:11:24    阅读次数:245
POJ 3083:Children of the Candy Corn(DFS+BFS)
Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9311 Accepted: 4039 Description The cornfield maze is a popular Hallowee...
分类:其他好文   时间:2014-07-17 21:09:46    阅读次数:319
POJ 1965 The Pilots Brothers' refrigerator 搜索
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18222   Accepted: 6936   Special Judge Description The game “The Pilots...
分类:其他好文   时间:2014-07-17 19:25:39    阅读次数:207
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!