Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define loop(i,b,e) for(auto i=b;i<=e;i++)
- const int N=1e5+1;
- int n,m,x,t[N],y,type2;
- vector<int> v;
- int main() {
- cin >> n >> m;
- loop(i,1,n)
- cin >> t[i];
- loop(i,1,m) {
- cin >> x;
- if (x == 2)
- type2++;
- else {
- cin >> y;
- t[y]--;
- if(t[y] < 0)
- v.push_back(y);
- }
- }
- int s = v.size();
- while(!v.empty()) {
- cout << v.back() << "\n";
- v.pop_back();
- }
- loop(i,0,type2-s-1)
- cout << "1\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement