We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
for(int i=0; i<Q;i++)
{
long int k=A[i][0];
if(k==1)
{
long int x=A[i][1];
t=((x^lastAns)%N);
list[t][a[t]]=A[i][2];
a[t]++;}
else{
long int x=A[i][1];
t=((x^lastAns)%N);
long int y=A[i][2];
long int size= y % a[t];
lastAns=list[t][size];
cout<<lastAns<<endl;
}
} is the logic right here ?
Dynamic Array
You are viewing a single comment's thread. Return to all comments →