#include<bits/stdc++.h>
using namespace std;
int n, x=1;
string str[25];
int main (){
cin >> n;
for (int i=0;i<n;i++)
cin >> str[i];
for (int i=1 ; i < n ; i++){
if (str[i] == str[i-1]) continue;
else x++;
}
if (str[n-1] == str[n-2]) x++;
cout << x;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
252 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
504 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
640 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
640 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
652 KB |
Output isn't correct |
6 |
Correct |
2 ms |
652 KB |
Output is correct |
7 |
Correct |
2 ms |
652 KB |
Output is correct |
8 |
Correct |
2 ms |
652 KB |
Output is correct |
9 |
Incorrect |
2 ms |
652 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
652 KB |
Output isn't correct |