Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- freopen("L4Q1.in", "r", stdin);
- freopen("L4Q1.out", "w", stdout);
- int n; //n de areas
- int k;
- while (cin >> n)
- {
- if (n != 0)
- {
- int saida = 0;
- int armazena[n];
- Fila mapa[n];
- for (int index = 0; index < n; index++)
- {
- cin >> k;
- armazena[index] = -1;
- while (k > 0)
- {
- //Lê a matriz
- int num;
- cin >> num;
- mapa[index].insere(num);
- k--;
- }
- }
- // for(int c = 0; c < n; c++)
- // {
- // mapa[c].imprimeFila();
- // cout << endl;
- // }
- saida = fazDFS(0, mapa, armazena);
- // for(int w = 0; w < n; w++)
- // {
- // if (caminhos[w] == true)
- // {
- // for (int v = 0; v < n; v++)
- // {
- // if (!caminhos[v])
- // {
- // int qtd = g.DFS(v, w);
- // armazena[w] += qtd;
- // }
- // }
- // }
- // else
- // {
- // armazena[w] = 0;
- // }
- // }
- cout << saida << endl;
- cout << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement