0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 17:36:27 +00:00
Baoshuo Ren 2022-06-25 20:12:13 +08:00
parent 985bd1e674
commit a237f25d9a
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

43
AtCoder/ABC257/B/B.cpp Normal file
View File

@ -0,0 +1,43 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 205;
int n, k, q, a[N];
bool s[N];
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n >> k >> q;
for (int i = 1; i <= k; i++) {
cin >> a[i];
s[a[i]] = true;
}
while (q--) {
int x;
cin >> x;
if (a[x] < n && !s[a[x] + 1]) {
s[a[x]] = false;
s[a[x] + 1] = true;
a[x]++;
}
}
for (int i = 1; i <= k; i++) {
cout << a[i] << ' ';
}
cout << endl;
return 0;
}