title: How to take input and show output in vector<vector<pair<int,int>>> in C++?
body: <p>I can take inputs and show outputs in the following type of vector:</p>
  
  <pre><code>vector&lt;pair&lt;int,int&gt;&gt;
  </code></pre>
  
  <p>But the type :</p>
  
  <pre><code>vector&lt;vector&lt;pair&lt;int,int&gt;&gt;&gt;
  </code></pre>
  
  <p>is confusing me.
  I need this data type to store Graph information on which I intend to do Depth First Search traversal.</p>
  
  <p>I tried compiling the following code. But after compilation, the program crashes. I will be thankful if someone corrects this code.</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;stdio.h&gt;
  #include&lt;vector&gt;
  #include&lt;utility&gt;
  
  using namespace std;
  
  typedef pair&lt;int,int&gt; ii;
  typedef vector&lt;ii&gt; vii;
  typedef vector&lt;vii&gt; vvii;
  typedef vector&lt;int&gt; vi;
  
  vvii AdjList;
  
  int main()
  {
      ii val;
      val.first=4,val.second=10;
      AdjList[0].push_back(val);
      cout&lt;&lt;AdjList[0][0].first;
      return 0;
  }
  </code></pre>