Guest User

Untitled

a guest
Jun 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. int v, a = 0, colorNumber = 0, pivo = 0;
  2. vector <int> possiveis;
  3. vector<int> adjacentes;
  4. cin >> v;
  5. cin.clear();
  6. cin.ignore();
  7. Grafo G = GRAFOInit(v);
  8.  
  9. cin >> a >> colorNumber >> pivo;
  10. cin.clear();
  11. cin.ignore();
  12. possiveis.push_back(pivo);
  13.  
  14. Cores* cores = new Cores[v];
  15. for (int i = 1; i <= v; i++) {
  16. cin >> cores[i].cor;
  17. cin.clear();
  18. cin.ignore();
  19. if (i == pivo) {
  20. cores[i].inundado = true;
  21. cores[i].flag = true;
  22. cores[i].colorido = true;
  23. }
  24. else {
  25. cores[i].inundado = false;
  26. cores[i].flag = false;
  27. cores[i].colorido = false;
  28. }
  29. }
  30.  
  31. for (int i = 0; i < a; i++) { // FOR para definir as arestas entre os vertices {
  32. int x, y;
  33. cin >> x;
  34. cin >> y;
  35. cin.clear();
  36. cin.ignore();
  37. GRAFOInsereArco(&G, x, y);
  38. }
  39. InundaGrafo(&G, pivo, cores, possiveis, adjacentes, colorNumber);
Add Comment
Please, Sign In to add comment