fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6.  
  7. bool compFun(int i) {
  8. return i == 1;
  9. }
  10.  
  11. int main() {
  12.  
  13. vector<int> a = {1, 2, 1, 2, 2, 1};
  14. vector<int> b = {1, 1, 1, 1, 1, 1};
  15.  
  16. cout << all_of(a.begin(), a.end(), compFun) << " " << all_of(b.begin(), b.end(), compFun) << endl;
  17.  
  18.  
  19.  
  20. // your code goes here
  21. return 0;
  22. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
0 1