mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-03 19:16:27 +00:00
B - Card Trick
https://codeforces.com/contest/1681/submission/158175100
This commit is contained in:
parent
a92e2474ba
commit
a1393e085e
37
Codeforces/1681/B/B.cpp
Normal file
37
Codeforces/1681/B/B.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 2e5 + 5;
|
||||
|
||||
int t, n, m, a[N];
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
|
||||
cin >> t;
|
||||
|
||||
while (t--) {
|
||||
long long t = 0;
|
||||
|
||||
cin >> n;
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cin >> a[i];
|
||||
}
|
||||
|
||||
cin >> m;
|
||||
|
||||
for (int i = 1, x; i <= m; i++) {
|
||||
cin >> x;
|
||||
|
||||
t += x;
|
||||
}
|
||||
|
||||
cout << a[t % n + 1] << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user