Last active
August 29, 2015 14:06
-
-
Save cocodrips/f57a1886295fec5bfbb7 to your computer and use it in GitHub Desktop.
Vectorについて調べる
This file contains hidden or 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 <iostream> | |
#include <map> | |
#include <string> | |
#include <vector> | |
#include <cstdio> | |
#include <math.h> | |
#include <algorithm> | |
#include <queue> | |
#include <tuple> | |
#include <stack> | |
using namespace std; | |
int main(int argc, const char * argv[]){ | |
vector<int> v1; | |
vector<int> v2; | |
int N = 100000; | |
for (int i = 0; i < N; ++i){ | |
v1.push_back(random() % 100); | |
} | |
v2 = v1; | |
int* a = &v1[0]; | |
for (int i = 0; i < N; ++i){ | |
if(a[i] != v2[i]){ | |
cout << a[i] <<" : " << v2[i] << endl; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment