2019-01-28 [HDU-2181]

include

include

using namespace std;
long long a[21][3];
int vist[25];
long long st[22];
int s = 1,p=0,o=1;
void d(long long n,long long s)
{
st[s] = n;
vist[n] = 1;

for (int i = 0; i < 3; i++)
{
    if (s == 20 && a[n][i] == st[1])
    {
        cout << o << ": ";
        for (int i = 1; i < 21; i++)
        {
            cout << " " << st[i];
        }
        cout <<" " <

}
int main()
{
for (int i = 1; i <= 20; i++)
cin >> a[i][0] >> a[i][1] >> a[i][2];
long long n;
while (cin >> n && n != 0)
{
memset(vist, 0, sizeof(vist));
d(n,1);
}

}

你可能感兴趣的:(2019-01-28 [HDU-2181])