#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using ld = long double;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const ll LINF = 2e18;
const double EPS = 1e-9;
#define EMT ios::sync_with_stdio(0); cin.tie(0);
bool prime_test(int n) {
for(int i = 2; i < n; i++)
if(n % i == 0)
return false;
return true;
}
void solve(int n) {
}
void solve_2(int n) {
int cnt[2] = {0}, k;
cin >> k;
for(int i = 0, a, b, c, d; i < n; i++) {
cin >> a >> b >> c >> d;
cnt[(a + b) % 2]++;
}
ll a = 1LL * n * n / 2, b = 1LL * n * n - a;
cout << min(cnt[1] + b - cnt[0], cnt[0] + a - cnt[1]) << '\n';
}
signed main() { EMT
int n;
cin >> n;
if(prime_test(n))
solve_2(n);
else
solve(n);
}
# |
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 |
27 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 |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
27 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 |
- |