title: When i try to define this vector< pair< int , pair<int, int> > > vp(n)
body: <p>There's in output Give me <code>0 0</code></p>
  
  <pre><code>#include &lt;bits/stdc++.h&gt;
  #define fsv(i , n)  for(int i = 0 ; i &lt; n ; ++i)
  using namespace std;
  
  int main()
  {
   int n ;
   cin &gt;&gt; n ;
   vector&lt; pair&lt; int , pair&lt;int, int&gt; &gt; &gt; vp(n);
   vector &lt;int&gt; v(n) ;
  
   fsv(i , v.size())cin &gt;&gt; v[i];
  
    for(int i = 0 ; i &lt; n ; ++i){
       for(int j = i+1 ; j &lt; n-1 ; ++j){
          vp.push_back(make_pair(abs(v[i]-v[j]) , make_pair(i,j)));
       }
    }
   sort(vp.begin() , vp.end());
  
   cout &lt;&lt; vp[0].second.first &lt;&lt; " " &lt;&lt; vp[0].second.second;
  
  }
  </code></pre>
  
  <p>this code related by code forces problem , i know that there's other ways ... but i'm asking this is proper way to access elements like that  ?!
  <a href="http://codeforces.com/contest/34/problem/A" rel="nofollow noreferrer">http://codeforces.com/contest/34/problem/A</a></p>