fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. typedef long double ld;
  5. #define all(x) begin(x), end(x)
  6.  
  7. const int N = 1e4;
  8. mt19937 rnd;
  9. ld a[N], b[N];
  10.  
  11. int main() {
  12. for (int i = 0; i < N; ++i) {
  13. a[i] = rnd();
  14. }
  15. for (int i = 0; i < N; ++i) {
  16. b[i] = rnd();
  17. }
  18.  
  19. auto st = chrono::system_clock::now();
  20.  
  21. ld h = 0;
  22. for (int it = 0; it < N; ++it) {
  23. for (int i = 0; i < N; ++i) {
  24. ld cur = a[i] / b[i];
  25. h += cur;
  26. }
  27. }
  28.  
  29. auto fn = chrono::system_clock::now();
  30.  
  31. assert(h != 19);
  32.  
  33. cout << fixed << setprecision(1) << 1000 * chrono::duration<double>(fn - st).count() << endl;
  34.  
  35. return 0;
  36. }
  37.  
Success #stdin #stdout 0.48s 4364KB
stdin
Standard input is empty
stdout
476.5