#include <iostream>
#include <algorithm>
#include <vector>

#define all(a) (a).begin(),(a).end()

using namespace std;

int main() {
  auto v1 = {1, 1, 1, 1, 1};
  auto v2 = {1, 1, 1, 2, 1};
  vector<vector<int>> v3 = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
  vector<vector<int>> v4 = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9, 0}};

  cout << all_of(all(v1), [](int i) -> bool {return i == 1;}) << endl;
  cout << all_of(all(v1), [](int i){return i == 1;}) << endl;
  cout << all_of(all(v2), [](int i){return i == 1;}) << endl;
  cout << all_of(all(v3), [](vector<int> v){return v.size() == 3;}) << endl;
  cout << all_of(all(v4), [](vector<int> v){return v.size() == 3;}) << endl;
}