title: How to sort an array of vectors in c++?
body: <p>I have created an array of vectors. After taking the input I have to sort them, I guess I need to use a comparator function but I cannot understand how do I use it.</p>
  <pre><code>int main()
  {
      
      int  n, k;
      cin &gt;&gt; n &gt;&gt; k;
      vector&lt;long long&gt; times[4];
    
      for (int i = 0; i &lt; n; ++i)
      {
          ll t, a, b;
          cin &gt;&gt; t &gt;&gt; a &gt;&gt; b;
          times[a * 2 + b].push_back(t);
      }
  
      cout &lt;&lt; times[0].size();
      ***//i need to sort the whole of times[0] after this***
  }
  </code></pre>