You are viewing a single comment's thread. Return to all comments →
Same for me :/ someone please help
int main() { int n,k,q,r=0; cin >>n>>k>>q;
int b[n]; int m[q]; for (int i=0;i<n;i++) { cin >> b[i]; } for (int i=0;i<q;i++) { cin >> m[i]; } for (int i=0;i<k;i++) { r=b[n-1]; for(int j=n-1;j>0;j--) { b[j]=b[j-1]; } b[0]=r; } for(int i=0;i<q;i++) { cout << b[m[i]]<<endl; } 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 →
Same for me :/ someone please help
int main() { int n,k,q,r=0; cin >>n>>k>>q;
}