You are viewing a single comment's thread. Return to all comments →
int n,k,q,temp,m,z; cin>>n>>k>>q; int a[n]; for(int x=0;x<n;x++) { cin>>a[x]; } k=k%n; for(int y=0;y<k;y++) { temp = a[n-1]; for(int q=n-1;q>=1;q--) { a[q]=a[q-1]; } a[0]=temp; } for(int u=0;u<q;u++) { cin>>m; cout<<a[m]<<endl; }
"Terminated due to timed out" on Case 5,12,13,14 ... help please .. Thanks !
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 →
"Terminated due to timed out" on Case 5,12,13,14 ... help please .. Thanks !