POJ 3311 Hie with the Pie -- TSP 상태 압축 dp

/*
	http://poj.org/problem?id=3311 Hie with the Pie
	     ,     dp
*/
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
#define CLR(c,v) memset(c,v,sizeof(c))

template 
_T Max(_T a, _T b){
	return (a>b)?(a):(b);
}
template 
_T Max(_T a, _T b,_T c){
	return (a>Max(b,c))?(a):(Max(b,c));
}

const int inf  = -(1<<30);
const int INF  =  (1<<30);
const int M    =  12;

int d[M][M];
int dp[(1< d[i][k] + d[k][j])
					d[i][j] = d[i][k] + d[k][j];
}

int main(){
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	int n;
	while(cin >> n,n){
		for(int i = 0; i <= n ; i++){
			for(int j = 0; j <= n ; j++){
				cin >> d[i][j]; // stand for distance[i->j]:d[i][j]
			}
		}
		floyd(n);
 		int bound = (1<

좋은 웹페이지 즐겨찾기