You are viewing a single comment's thread. Return to all comments →
can anyone please tell that what is teminated due to timeout
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int main(){ int n,k,q,temp,i,j,a[100000],b[500]; scanf("%d %d %d",&n,&k,&q); for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(j=0;j<k;j++) { temp=a[n-1]; for(i=n-1;i>0;i--) a[i]=a[i-1]; a[0]=temp; } for(i=0;i<q;i++) scanf("%d",&b[i]); for(i=0;i<q;i++) printf("%d\n",a[b[i]]); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Circular Array Rotation
You are viewing a single comment's thread. Return to all comments →
can anyone please tell that what is teminated due to timeout