``` #include <bits> using namespace std; const int N = 1e5 + 50; int a[N]; int f[N]; int main() { int n, s; cin >> n >> s; for (int i = 0; i < n; i++) cin >> a[i]; int l = 0, r = s; int cnt = (int)(n / s); while (cnt--) { for (int i = r-1; i >= l; i--) { int x; cin >> x; f[a[i]] = x; } l = r; r += s; } int q; cin >> q; while (q--) { int x; cin >> x; if (f[x])cout << f[x] << endl; else cout << "Wrong Number" << endl; } return 0; } ```</bits>
点赞

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务