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.
while(q--)
{
int a,x,y;
scanf("%d %d %d\n",&a,&x,&y);
// printf("%d %d %d\n",a,x,y);
if(a==1)
{
int j;
j=(bitxor(x,la)%n);
sl[j][size[j]] = y;
++(size[j]);
}
else if(a==2)
{
int j;
j=(bitxor(x,la)%n);
int k=size[j];
int l = y%k;
la = sl[j][l];
printf("%d\n",la);
}
}
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
return 0;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Dynamic Array
You are viewing a single comment's thread. Return to all comments →
The code below is on the same lines as your code, but please tell me the mistake. I am getting a lot of segmentation faults.
include
include
include
include
int bitxor(int a,int b) { return (a^b); }
int main() { int ** sl; int la=0,n,i,q; int *size;
// printf("%d %d\n",n,q);
}