Advertisement
socialgraph

Untitled

Jul 9th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     vector<vector<int>> v = {{0, 1, 2},
  9.                              {},
  10.                              {0}};
  11.     auto count = count_if(
  12.         begin(v), end(v),
  13.         [](const vector<int>& s) {
  14.             return s.size() > 0;
  15.         }
  16.     );
  17.     cout << count << endl;
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement