Advertisement
Guest User

Untitled

a guest
Dec 26th, 2016
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. unsigned int a, b, c[100000], d[1000], w;
  5.  
  6.  
  7. int main ()
  8. {
  9.  
  10.     std::ios::sync_with_stdio(0);
  11.  
  12.  
  13.     cin>>a>>b;
  14.  
  15.     for (int i=0; i<b; i++)
  16.     {
  17.         cin>>c[i];
  18.         for (int k=0; k<a; k++)
  19.         {
  20.             if(c[i]==a-k) d[k]++;
  21.             else cout<<"";
  22.  
  23.         }
  24.  
  25.     }
  26.  
  27.     for (int k=0; k<a; k++)
  28.     {
  29.         if (d[k]%2!=0)
  30.         {
  31.             w++;
  32.         }
  33.         else cout<<"";
  34.     }
  35.  
  36.  
  37.     cout<<w;
  38.  
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement