#include<bits/stdc++.h>
#define N 800010
using namespace std;
vector <int> g[N];
int main(){
int n, q;
cin >> n >> q;
for(int i = 1;i <= n;i++){
int t;
cin >> t;
while(t--){
int x;
cin >> x;
g[i].push_back(x);
}
}
for(int i = 0;i < q;i++){
int x;
cin >> x;
x %= (2*n-2);
if(0 <= x and x <= n-1){
cout << x+1 << '\n';
}
else{
x -= n-1;
cout << n-x << '\n';
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
19036 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
19036 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
19632 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
19036 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |