/*
//\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\
\\ //
// 271828___182845__904523__53602__ \\
\\ 87___47____13______52____66__24_ //
// 97___75____72______47____09___36 \\
\\ 999595_____74______96____69___67 //
// 62___77____24______07____66__30_ \\
\\ 35___35____47______59____45713__ //
// \\
\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\//
*/
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <climits>
#include <algorithm>
#include <random>
#include <queue>
#include <deque>
#include <iomanip>
#include <string>
#include <tuple>
#include <bitset>
#include <chrono>
#include <ctime>
#include <fstream>
#include <stack>
#include <cstdio>
using namespace std;
using ll = long long;
const int N = 3e5 + 5;
const ll mod = 1e9 + 7, inf = 1e18;
void solve() {
ll n, k; cin >> n >> k;
ll od = 0, ev = 0;
while (k--) {
int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
if (x1 % 2 == y1 % 2) ++ev;
else ++od;
}
// sksvi sevov
ll a = od + (n * n + 1) / 2 - ev;
// sksvi spitakov
ll b = ev + (n * n) / 2 - od;
cout << min(a, b);
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
//int t; cin >> t;
//while (t--)
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
312 KB |
Output is correct |
2 |
Correct |
5 ms |
212 KB |
Output is correct |
3 |
Correct |
12 ms |
1196 KB |
Output is correct |
4 |
Correct |
13 ms |
1100 KB |
Output is correct |
5 |
Correct |
16 ms |
1576 KB |
Output is correct |
6 |
Correct |
10 ms |
1108 KB |
Output is correct |
7 |
Correct |
3 ms |
468 KB |
Output is correct |
8 |
Correct |
10 ms |
1108 KB |
Output is correct |
9 |
Correct |
28 ms |
2368 KB |
Output is correct |
10 |
Correct |
15 ms |
1448 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
312 KB |
Output is correct |
2 |
Correct |
5 ms |
212 KB |
Output is correct |
3 |
Correct |
12 ms |
1196 KB |
Output is correct |
4 |
Correct |
13 ms |
1100 KB |
Output is correct |
5 |
Correct |
16 ms |
1576 KB |
Output is correct |
6 |
Correct |
10 ms |
1108 KB |
Output is correct |
7 |
Correct |
3 ms |
468 KB |
Output is correct |
8 |
Correct |
10 ms |
1108 KB |
Output is correct |
9 |
Correct |
28 ms |
2368 KB |
Output is correct |
10 |
Correct |
15 ms |
1448 KB |
Output is correct |
11 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |