• + 0 comments

    Time out in last three case my C++ code is int findMaxIndex(vector a,int n) { int c=INT_MIN,index; for(int i=0;ic) { c=a[i]; index=i; } } return index; } int main(){ int g,count; cin >> g; for(int a0 = 0; a0 < g; a0++){ int n; count=0; cin >> n; vector a(n); for(int i=0;i>a[i]; } while(n!=0) { n=findMaxIndex(a,n); count=count+1; } if(count%2==0) cout<<"ANDY\n"; else cout<<"BOB\n"; } return 0; } any body can explian me , why ?