mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 05:48:48 +00:00
P1160 队列安排
R43142038
This commit is contained in:
parent
5b24a25a0f
commit
0ee0a08c04
27
problem/P1160/P1160.cpp
Normal file
27
problem/P1160/P1160.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int n, k, p, x;
|
||||
vector<int> a;
|
||||
map<int, bool> m;
|
||||
|
||||
int main() {
|
||||
scanf("%d", &n);
|
||||
a.push_back(0);
|
||||
a.push_back(1);
|
||||
for (int i = 2; i <= n; i++) {
|
||||
scanf("%d%d", &k, &p);
|
||||
a.insert(find(a.begin(), a.end(), k) + p, i);
|
||||
}
|
||||
scanf("%d", &n);
|
||||
while (n--) {
|
||||
scanf("%d", &x);
|
||||
m[x] = 1;
|
||||
}
|
||||
for (vector<int>::iterator it = a.begin() + 1; it != a.end(); it++) {
|
||||
if(!m[*it]) printf("%d ", *it);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user