title: Can't access vector element?
body: <p>I have this code</p>
  
  <pre><code>vector &lt;int&gt; a[100001];
  a[1].push_back(1);
  if( a[1][0] == 1)
        cout&lt;&lt;"OK!";
  </code></pre>
  
  <p>But when I try to access a<a href="https://i.stack.imgur.com/p79dG.png" rel="nofollow noreferrer">1</a>[0] it says: </p>
  
  <pre><code>CXX0058: Error: overloaded operator not found
  </code></pre>
  
  <p>Full code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;vector&gt;
  using namespace std;
  FILE *f=fopen("chei.in","r");
  FILE *g=fopen("chei.out","w");
  int t[100001],N,x,nr,k,d;
  vector &lt;int&gt; a[100001];
  int main(){
      fscanf(f,"%d",&amp;N);
      for(int i=1;i&lt;=N;++i)
      { fscanf(f,"%d",&amp;x);
        for(k=0;k&lt;a[i].size();++k){
                 if( a[i][k]== x)
                     break;}
        if(k==0 || ( k==a[x].size() &amp;&amp; a[i][k] == x )){
                t[i]=x;
                a[x].push_back(i);
        }
      }
  for(int i=1;i&lt;=N;i++){
          if(t[i]==i || t[i]==0)
              nr++;}
  fprintf(g,"%d",nr);
  return 0;
  }
  </code></pre>
  
  <p>Here's a screenshot of the watch:
  <img src="https://i.stack.imgur.com/p79dG.png" alt="alt text"></p>