poj2362

#include
#include
#include
int n,side;//num
int stick[270];
bool vis[270];
int ok;

int cmp(const void *a,const void *b){
	return *(int *)b-*(int *)a;
}

void DFS(int num,int len,int s){
	int i;
	if(num==3){
		ok=1;
		return;
	}
	if(ok==1)return;

	for(i=s;iside||tp_sum%4!=0){
		printf("no\n");
		continue;
	}

	ok=0;
	vis[0]=true;
	DFS(0,0,0);//当前得到的正方形为0,从第0个棒开始,该边的长度长度为0
	if(ok==1){
		printf("yes\n");
	}
	else
		printf("no\n");
	}

	return 0;
}

  难得DFS写出来了。。

转载于:https://www.cnblogs.com/xxx0624/archive/2012/07/19/2599156.html

你可能感兴趣的:(poj2362)