You are viewing a single comment's thread. Return to all comments →
It's for C (''Godspeed!")
#include <stdio.h> int main() { int n, k, m, mx; scanf("%d %d %d", &n, &k, &m); int nums[n]; for (int i = 0; i < n; i++) scanf("%d", &nums[i]); while (m--) { scanf("%d", &mx); printf("%d\n", nums[(n + mx - (k % n)) % n]); } 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 →
It's for C (''Godspeed!")