#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int main()
{
int n, k = 0;
cin >> n;
vector<int> a(3);
for(int i = 0; i < n * 2; i++)
{
int x, y;
cin >> x >> y;
x = max(1, min(n, x));
y = max(1, min(2, y));
a[y]++;
}
int x1 = a[1] - n;
int x2 = a[2] - n;
k += abs(x1) + abs(x2);
cout << k;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |