#include #include #include #include #include using namespace std; #define REP(i,first,last) for (int i=first;i game_results_pattern; int main(){ cin>>n; char val; //inputを表にする REP(i,0,n){ REP(j,0,n){ cin >> val; game_results[i][j] = val; cout<> que; que.push(game_results_pattern); while (!que.empty()) { vector q = que.front(); que.pop(); vector::iterator it = find(q.begin(), q.end(), '-'); if (it != q.end()) { q[it - q.begin()] = 'o'; que.push(q); q[it - q.begin()] = 'x'; que.push(q); } else { int c = 0; vector points(6); REP(i,0,n){ REP(j,i+1,n){ if (q[c] == 'o') { points[i] += 1; } else { points[j] += 1; } c++; } } sort(points.begin(), points.end(), greater()); // points.erase(unique(points.begin(), points.end()), points.end()); //win_count_0が何番目に入っているかを確認 vector::iterator it = find(points.begin(), points.end(), win_count_0); int new_result = it - points.begin() + 1; result = (new_result < result) ? new_result : result; } } cout<