when using C++ vector, time spent is 718 milliseconds, while when I use Array, time is almost 0 milliseconds.
Why so much performance difference?
int
If you are compiling this with a Microsoft compiler, to make it a fair comparison you need to switch off iterator security checks and iterator debugging, by defining _SECURE_SCL=0 and _HAS_ITERATOR_DEBUGGING=0.
Secondly, the constructor you are using initialises each vector value with zero, and you are not memsetting the array to zero before filling it. So you are traversing the vector twice.
Try:
vector v;
v.reserve(size*size);