fork download
  1. #include <iostream>
  2. #include <map>
  3. #include <bitset>
  4. using namespace std;
  5.  
  6. map<int, int> fr;
  7.  
  8. int main() {
  9. bitset<1000010> fr;
  10. bitset<1000010> db;
  11. int x, nr = 0;
  12. while(cin >> x) {
  13. if(fr[x]) db[x] = 1;
  14. fr[x] = 1;
  15. }
  16. for (int i = 1; i <= 1000000; i++) {
  17. if(fr[i] && !db[i])
  18. nr++;
  19. }
  20. cout << nr;
  21. }
  22.  
Success #stdin #stdout 0.01s 5288KB
stdin
5 4 3 2 3 3 5 6 4 3 3
stdout
2