SHARE
TWEET

Untitled

a guest Dec 6th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /******************************************************************************
  2.  
  3.                               Online C++ Compiler.
  4.                Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13. mt19937 gen(55);
  14.  
  15.  
  16. void test(int razmer_vectorov_kotorie_anya_budet_peremnozhat) {
  17.     vector<int> first(razmer_vectorov_kotorie_anya_budet_peremnozhat),
  18.                 second(razmer_vectorov_kotorie_anya_budet_peremnozhat);
  19.     for (auto& el : first) {
  20.         el = gen() % 10;
  21.     }
  22.     for (auto& el : second) {
  23.         el = gen() % 10;
  24.     }
  25.     high_resolution_clock::time_point t1 = high_resolution_clock::now();
  26.     // multiply(first, second);
  27.     high_resolution_clock::time_point t2 = high_resolution_clock::now();
  28.     duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
  29.     std::cout << time_span.count() << '\n';
  30. }
  31.  
  32. int main()
  33. {
  34.     freopen("output.txt", "w", stdout);
  35.     for (int i = 100; i < 100000; i += 100)
  36.         test(i, gen);
  37.     return 0;
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top