Advertisement
DimasDark

dssdsdsddssd

Sep 3rd, 2013
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.50 KB | None | 0 0
  1. int main()
  2. {
  3.     freopen("L4Q1.in", "r", stdin);
  4.     freopen("L4Q1.out", "w", stdout);
  5.  
  6.     int n; //n de areas
  7.     int k;
  8.     while (cin >> n)
  9.     {
  10.         if (n != 0)
  11.         {
  12.             int saida = 0;
  13.             int armazena[n];
  14.             Fila mapa[n];
  15.             for (int index = 0; index < n; index++)
  16.             {
  17.                 cin >> k;
  18.                 armazena[index] = -1;
  19.                 while (k > 0)
  20.                 {
  21.                     //Lê a matriz
  22.                     int num;
  23.                     cin >> num;
  24.                     mapa[index].insere(num);
  25.                     k--;
  26.                 }
  27.             }
  28.  
  29. //            for(int c = 0; c < n; c++)
  30. //            {
  31. //                mapa[c].imprimeFila();
  32. //                cout << endl;
  33. //            }
  34.  
  35.             saida = fazDFS(0, mapa, armazena);
  36.  
  37.  
  38. //            for(int w = 0; w < n; w++)
  39. //            {
  40. //                if (caminhos[w] == true)
  41. //                {
  42. //                    for (int v = 0; v < n; v++)
  43. //                    {
  44. //                        if (!caminhos[v])
  45. //                        {
  46. //                            int qtd = g.DFS(v, w);
  47. //                            armazena[w] += qtd;
  48. //                        }
  49. //                    }
  50. //                }
  51. //                else
  52. //                {
  53. //                    armazena[w] = 0;
  54. //                }
  55. //            }
  56.  
  57.             cout << saida << endl;
  58.             cout << endl;
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement