Created
April 12, 2019 04:52
-
-
Save niconiconi/b7492030910e961c686d613d87ffaef3 to your computer and use it in GitHub Desktop.
map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <map> | |
#include <ctime> | |
#include <cstdlib> | |
#include <cstdio> | |
using namespace std; | |
map<int, int> my_map; | |
int main() | |
{ | |
srand(time(0)); | |
clock_t t0 = clock(); | |
const int n = 1000000; //1e6 | |
for(int i = 0; i < n; ++i) | |
my_map[rand()] = rand(); | |
printf("Time: %f\n", ((float)clock() - t0) / CLOCKS_PER_SEC); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment