摘要: 解题思路:1 如果图中所有的点连通且度都为偶数则可以一笔画成。 2 如果图中有不超过2个点的度为奇数则可以一笔画。 3做法显然先通DFS判断图是否连通过,然后在判断图中奇数点度的个数即可。 View Code 1 #include<cstdio> 2 #include<cstdlib> 3 #include<cstring> 4 #include<iostream> 5 #define N 1010 6 7 using namespace std; 8 9 int G[N][N], vis[N], num[N];10 int P, Q, ok;1 阅读全文
posted @ 2012-04-25 22:25 zhongya 阅读(178) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #define N 1000001 5 6 char s[N]; 7 int main() 8 { 9 int i, j, len,ok;10 11 while(scanf("%s",s)!=EOF && strcmp(s,"."))12 {13 len = strlen(s);14 for(i=1; i<=len; i++)15 {16 ... 阅读全文
posted @ 2012-04-25 08:33 zhongya 阅读(241) 评论(0) 推荐(1) 编辑