Well you are declaring an array of 20 vectors. So right way would be
D[1].push_back(make_pair(0,make_pair(1,2));
int a = D[1][0].first;
pair<int,int> b = D[1][0].second;
b.second++; // You now have a pair containing increased value. Original remains unchanged.
int z = D[1][0].second.second; // contains the nested pair's second value
If you want to increase the second – then do it directly.
D[1][0].second.second++; // originally changed.
If you want to get pair which is in the last position you can get the size of the vector and validate and then get the last inserted element.
0
solved How to access vector