Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int nPlayer, nJog, id, nPIsOn, vorf, answ, cont = 1;
  10.     vector<int>v;
  11.     vector<int>::iterator it;
  12.     while(cin >> nPlayer >> nJog && nPlayer != 0 && nJog != 0) {
  13.         v.clear();
  14.         while(nPlayer--) {
  15.             cin >> id;
  16.             v.push_back(id);
  17.         }
  18.         while(nJog--) {
  19.             cin >> nPIsOn >> vorf;
  20.             it = v.begin();
  21.             for(int i = 0; i < nPIsOn; i++) {
  22.                 cin >> answ;
  23.                 if(answ != vorf) {
  24.                     v.erase(it);
  25.                     it--;
  26.                 }
  27.                 it++;
  28.             }
  29.         }
  30.         cout << "Teste " << cont++ << endl;
  31.         for(vector<int>::iterator i = v.begin(); i < v.end(); i++)
  32.             cout << *i << endl;
  33.         cout << endl;
  34.     }
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement