7.5 Given two squares on a two-dimensional plane, find a line that would cut these two squares in half. Assume that the top and the bottom sides of th...
分类:
其他好文 时间:
2015-09-01 08:03:06
阅读次数:
191
Palindrome graphTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1727Accepted Submission(s): 525Pro...
分类:
其他好文 时间:
2015-09-01 01:35:35
阅读次数:
199
http://acm.hdu.edu.cn/showproblem.php?pid=5424/*对于一个连通图,有N个顶点,如果有N条边,那么肯定有环因为N个点如果不成环最多N-1条边。。。然后找最小度的点DFS就行。。。 *//***********************************...
分类:
其他好文 时间:
2015-08-31 21:09:58
阅读次数:
96
#include
using namespace std;
int n,m,k;
int yy[60];
int g[30][30];
bool jud(int x,int y,int i){
if(x=n||y=m) return true;
if(g[x][y]!=i) return true;
return false;
}
bool Cut(int step)
{
...
分类:
其他好文 时间:
2015-08-31 19:39:25
阅读次数:
161
http://acm.hdu.edu.cn/showproblem.php?pid=5424哈密顿通路:联通的图,访问每个顶点的路径且只访问一次n个点n条边n个顶点有n - 1条边,最后一条边的连接情况:(1)自环(这里不需要考虑);(2)最后一条边将首和尾连接,这样每个点的度都为2;(3)最后一条...
分类:
其他好文 时间:
2015-08-31 19:12:02
阅读次数:
130
题目连接http://poj.org/problem?id=1679The Unique MSTDescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique.Definition ...
分类:
其他好文 时间:
2015-08-31 16:52:10
阅读次数:
123
HDU 5424 Rikka with Graph II
【题目链接】:click here~~
代码:
#include
using namespace std;
const int N=1005;
vector g[N];
bool vis[N];
int dg[N];
int cnt;
int n,u,v;
bool ok;
void dfs(int u,int cur)
{
...
分类:
其他好文 时间:
2015-08-31 01:14:10
阅读次数:
274
Easy Graph Problem?题目抽象:给你一个n * m 的矩阵.每个格子是数字或者障碍物'*'. 第一问:从起点到终点的最短路.第二问:要求相同的方向不能连续走两次,也就是每到达一个格子,需要改变方向.问最短路. 不过不存在就输出-1.分析:可以直...
分类:
其他好文 时间:
2015-08-31 00:47:19
阅读次数:
239
题目地址:HDU 5422
题意:
思路:
如果连上1-n的边,最短距离就是1。所以所有情况下最短距离都是1。考虑方案数,如果本来没有1-n的边,那么只能连1-n,方案数为1。否则怎么连都可以,方案数是n*(n-1)/2。int main()
{
int n,m;
int x,y;
while(~scanf("%d %d",&n,&m)) {
int...
分类:
其他好文 时间:
2015-08-30 19:38:42
阅读次数:
134
We have a graph with size = N like that in Figure 1. Then we are going to find a downward path from the top node to one bottom node.
First, we select the top node as the beginning. Then at any no...
分类:
其他好文 时间:
2015-08-30 19:35:58
阅读次数:
185