UVa10654The Uxuhul Voting System(二)

2014-11-24 08:11:26 · 作者: · 浏览: 1
nclude using namespace std; const int maxn = 100+10; const int INF = 1e9; int mat[maxn][8]; int dp[maxn][8]; map tma; int m; int dfs(int dep,int statu){ if(dep==m){ int tk = -1,ans = INF; for(int i = 0; i <= 2; i++){ if(ans > mat[m][statu^(1< mat[dep][dfs(dep+1,statu^(1<
> ncase; tma[0] = "NNN",tma[1]="NNY",tma[2]="NYN",tma[3]="NYY",tma[4]="YNN",tma[5]="YNY",tma[6]="YYN",tma[7]="YYY"; while(ncase--){ cin >> m; memset(dp,-1,sizeof dp); for(int i = 1; i <= m; i++) for(int j = 0; j < 8; j++) cin >> mat[i][j]; cout<