Skip to content

Instantly share code, notes, and snippets.

@cocodrips
Last active August 29, 2015 14:06
Show Gist options
  • Save cocodrips/f57a1886295fec5bfbb7 to your computer and use it in GitHub Desktop.
Save cocodrips/f57a1886295fec5bfbb7 to your computer and use it in GitHub Desktop.
Vectorについて調べる
#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