#include <iostream>
#include <unordered_map>
using namespace std;
int main ()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long n, a, b, sum = 1, preva;
cin >> n;
for(long long i = 0;i < n;++i)
{
cin >> a >> b;
if(i != 0)
{
if(a != preva)
sum++;
}
preva = a;
}
cout << sum;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1267 ms |
296 KB |
Output is correct |
2 |
Correct |
1459 ms |
13844 KB |
Output is correct |
3 |
Correct |
1361 ms |
13528 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1553 ms |
300 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1267 ms |
296 KB |
Output is correct |
2 |
Correct |
1459 ms |
13844 KB |
Output is correct |
3 |
Correct |
1361 ms |
13528 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |