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