fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. typedef double ld;
  5. #define all(x) begin(x), end(x)
  6.  
  7. const int N = 1e5;
  8. mt19937 rnd;
  9.  
  10. int main() {
  11.  
  12. auto st = chrono::system_clock::now();
  13.  
  14. vector<int> v;
  15. for (int i = 0; i < N; ++i) {
  16. v.insert(v.begin(), rnd());
  17. }
  18.  
  19. auto fn = chrono::system_clock::now();
  20.  
  21. int h = 0;
  22. for (int e : v) {
  23. h = 3 * h + e;
  24. }
  25.  
  26. cerr << "hash " << h << endl;
  27. cout << fixed << setprecision(1) << 1000 * chrono::duration<double>(fn - st).count() << endl;
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout #stderr 0.65s 4380KB
stdin
Standard input is empty
stdout
652.1
stderr
hash 369507897