题目链接:http://vj.hsacm.com/problem/visitOriginUrl.action?id=74912
#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
#include <vector>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
if (n == )
break;
int peo[][];
int happy[];
for (int i = ; i <= n; ++i)
{
for (int j = ; j <= n; ++j)
{
cin >> peo[i][j];
happy[i] = ;
}
}
for (int k = ; k <= n;)
{
int sum = ;
for (int i = ; i <= n; ++i)
sum += happy[i] * peo[k][i];
sum *= happy[k];
if (sum < )
{
happy[k] *= -;
k = ;
continue;
}
k++;
}
cout << "Yes" << endl;
for (int i = ; i <= n; ++i)
cout << (happy[i] == ? "+" : "-") << endl;
}
return ;
}