Advertisement
amine99

Untitled

Apr 12th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define loop(i,b,e) for(auto i=b;i<=e;i++)
  4.  
  5. const int N=1e5+1;
  6. int n,m,x,y,type2;
  7. vector<int> v;
  8.  
  9. int main() {
  10.     cin >> n >> m;
  11.     loop(i,1,n)
  12.         cin >> t[i];
  13.     loop(i,1,m) {
  14.         cin >> x;
  15.         if (x == 2)
  16.             type2++;
  17.         else {
  18.             cin >> y;
  19.             t[y]--;
  20.             if(t[y] < 0)
  21.                 v.push_back(y);
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement