Advertisement
AlenAntonelli

I

Jun 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #define INDET 2
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     vector<int> v (11, INDET);
  10.     int n;
  11.    
  12.     cin>>n;
  13.    
  14.     int c=0, ID, p;
  15.     for(int i=0; i<n; i++)
  16.     {
  17.         cin>>ID>>p;
  18.         if ( v[ID]==INDET )
  19.             v[ID]=p;
  20.         if (v[ID]!=p)
  21.         {
  22.             v[ID]=p;
  23.             c++;
  24.         }
  25.            
  26.     }
  27.     cout<<c<<endl;
  28.    
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement