Advertisement
rengetsu

Codeforces_344A

Aug 9th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. //Codeforces Round 344A
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n, nn[100001], answ=1;
  7.     cin >> n;
  8.     for(int i=0;i<n;i++)
  9.     {
  10.         cin >> nn[i];
  11.         if(i!=0)
  12.         {
  13.             if(nn[i]!=nn[i-1])
  14.             {
  15.                 answ++;
  16.             }
  17.         }
  18.     }
  19.     cout << answ;
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement