this program is crashing,why? :     #include<iostream>
    #include<vector>
    #include<algorithm>
    using namespace std;
    int main()
    {
        vector<pair<int,int> > arr;
        arr[0].first=20,arr[0].second=1;
        arr[1].first=3,arr[1].second=2;
        arr[2].first=230,arr[2].second=3;
        arr[3].first=230,arr[3].second=4;
        arr[4].first=202,arr[4].second=5;
        arr[5].first=-20,arr[5].second=6;
        sort(arr.begin(),arr.end());
        vector<pair<int,int> >::iterator it;
        for(it=arr.begin();it!=arr.end();it++)
        {
            cout<<it->first<<it->second<<endl;
        }
    }

> This program isn't running properly,what can be possible reason behind this?
also I wanna have sorted pairs vector in which sorting is done by the value.

