Advertisement
Derga

Untitled

May 8th, 2023
746
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. for (int comp = 0; comp < all_components.size(); comp++) {
  2.         bool find_edge = true;
  3.         for (int vert : all_components[comp]) {
  4.             for (int child : graph[vert]) {
  5.                 if (which_comp[child] != comp) {
  6.                     find_edge = false;
  7.                 }
  8.             }
  9.         }
  10.         if (find_edge) {
  11.             stock++;
  12.         }
  13.     }
  14.  
  15.     for (int comp = 0; comp < all_components.size(); comp++) {
  16.         bool find_edge = true;
  17.         for (int vert : all_components[comp]) {
  18.             for (int child : t_graph[vert]) {
  19.                 if (which_comp[child] != comp) {
  20.                     find_edge = false;
  21.                 }
  22.             }
  23.         }
  24.         if (find_edge) {
  25.             not_stock++;
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement