# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
378599 | 2021-03-17T02:07:57 Z | LittleCube | Chessboard (IZhO18_chessboard) | C++14 | 77 ms | 2284 KB |
#include <bits/stdc++.h> #define int long long using namespace std; /************************************* * * Without Subtask 4 : 70 points * */ struct point { int x1, y1, x2, y2; }; signed main() { int n, m, k, ans = 0; cin >> n >> k; vector<point> v(k); for (int i = 0; i < k; i++) cin >> v[i].x1 >> v[i].y1 >> v[i].x2 >> v[i].y2; for (int i = 1; i <= sqrt(n); i++) if (n % i == 0) { int l = 0, r = 0; for (auto j : v) if (((j.x1 + i - 1) / i + (j.y1 + i - 1) / i) % 2) r++; else l++; //cout << i << " " << min({(n * n - i * i + 1) / 2 - l + r, (n * n - i * i) / 2 + l - r}) << '\n'; ans = min({ans, (n * n - i * i) / 2 + i * i - l + r, (n * n - i * i) / 2 + l - r}); } cout << ans << '\n'; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 77 ms | 2284 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 77 ms | 2284 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |