Why does the following segments give various outputs??

Revision en1, by always_4ever_5_25__21_SS, 2018-01-13 19:10:15

#include<bits/stdc++.h> using namespace std; typedef long long LL ; vector <LL> v[100]; vector <LL> v1; int main(){ cout << v[1].size() - 1 << endl; //This gives output 4294967295 int sz = v[1].size() - 1; cout << sz << endl; //This gives output -1 LL sz1 = v[1].size() - 1; cout << sz1 << endl; //This gives output 4294967295 cout << v[1].size() << endl; //This gives output 0 cout << v1.size() - 1 << endl; //This gives output 4294967295 cout << v1.size() << endl; //This gives output 0 }

Can anyone give any explanation? I lost a lot of valuable time in the contests for these stuffs and I can't understand why.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English always_4ever_5_25__21_SS 2018-01-13 19:10:15 779 Initial revision (published)