fork(2) download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <set>
  4. #include <algorithm>
  5. #include <functional>
  6.  
  7. using namespace std;
  8. using namespace placeholders;
  9.  
  10. int main()
  11. {
  12. istream_iterator<int> begin(cin), end;
  13.  
  14. set<int> remainders;
  15. transform(begin, end, inserter(remainders, remainders.begin()), bind(modulus<int>(), _1, 37));
  16.  
  17. cout << remainders.size();
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 3068KB
stdin
1
38
39
75
76
77
112
113
114
115
149
150
151
153
154
stdout
6