fork download
  1. #include <unordered_map>
  2. #include <iostream>
  3. #include <ctime>
  4. using namespace std;
  5.  
  6. int main(){
  7. unordered_map<int,int> m;
  8. int n = 100000;
  9. int b = m.bucket_count();
  10. cout << b << endl;
  11.  
  12. clock_t prev = clock();
  13. for(int i = 0; i < n; i++){
  14. ++m[m.bucket_count()*i];
  15. if(i%1000 == 0){
  16. clock_t cur = clock();
  17. cout << 1.*(cur - prev) / CLOCKS_PER_SEC << endl;
  18. prev = cur;
  19. }
  20. }
  21. }
  22.  
Time limit exceeded #stdin #stdout 5s 4208KB
stdin
Standard input is empty
stdout
1
9e-06
0.002775
0.009256
0.016502
0.02709
0.017152
0.039917
0.062724
0.044375
0.022976
0.046437
0.07021
0.094079
0.117619
0.141543
0.165129
0.03981
0.032209
0.05639
0.081087
0.105777
0.130234
0.154921
0.179485
0.204088
0.228863
0.253512
0.278151
0.302824
0.327355
0.352124
0.273371
0.019571
0.044409
0.070001
0.095031
0.12022
0.145832
0.171267
0.196792
0.222499