DFS
文章平均质量分 74
japomica
这个作者很懒,什么都没留下…
展开
-
UVA 539 - The Settlers of Catan 解题报告
搜索即可,图为无向图。找出能走的不重复的边的最大数#include #include#include#include#define maxn 30using namespace std;int map[maxn][maxn];int vis[maxn][maxn];int point_num;int edge_num;int max_num;void dfs(int原创 2013-08-05 18:15:55 · 643 阅读 · 0 评论 -
UVA 639- Don't Get Rooked
In chess, the rook is a piece that can move any number of squares vertically or horizontally. In this problem we will consider small chess boards (at most 44) that can also contain walls through whi原创 2013-08-05 18:27:36 · 436 阅读 · 0 评论 -
POJ1040 Transportation
Transportation Ruratania is just entering capitalism and is establishing new enterprising activities in many fields including transport. The transportation company TransRuratania is starti原创 2013-08-06 19:10:18 · 604 阅读 · 0 评论 -
uva-10344 - 23 out of 5
全排列+回溯(不过用的是DFS,囧)题意:给出5个数字,顺序可以任意排列,有三种运算:加、减、乘,不考虑优先级,按顺序计算,判断能否有一种方案得出的结果是23。#include #include using namespace std;int a[5],visit[5];int dfs(int n){ int flag; if(visit[0]+visi原创 2013-08-07 10:42:29 · 505 阅读 · 0 评论 -
codeforces 60B Serial Time!
Serial Time!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Cereal Guy's friend Serial Guy likes to watc原创 2013-08-07 13:47:07 · 1142 阅读 · 0 评论 -
HDU1010
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 54289 Accepted Submission(s): 14618Problem DescriptionThe dogg原创 2013-08-09 19:47:55 · 432 阅读 · 0 评论