fork(1) download
  1. #include <unordered_map>
  2. #include <iostream>
  3.  
  4. int main() {
  5. std::unordered_map<int64_t, int> y;
  6. for (int i = 0; i < 100000; ++i) {
  7. y[i] = 1;
  8. }
  9. int64_t mgc = y.bucket_count();
  10. std::cout << mgc << std::endl;
  11. std::unordered_map<int64_t, int> x;
  12.  
  13. for (int i = 0; i < 100000; ++i) {
  14. x[i * mgc] = 1;
  15. }
  16. int sum = 0;
  17. for (int i = 0; i < 100000; ++i) {
  18. sum += x[i * mgc];
  19. }
  20. std::cout << sum;
  21. }
  22.  
Time limit exceeded #stdin #stdout 5s 8416KB
stdin
Standard input is empty
stdout
126271