#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;
const int N = 3e5 + 1;
int n, m;
int w[N];
int cnt[20];
signed main () {
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
cin >> n >> m;
for (int i = 1; i <= n; ++i)
for (int j = 0; j < m; ++j) {
int x;
cin >> x;
w[i] ^= (1 << j) * x;
cnt[j] += x;
}
if (n <= 3000) {
for (int i = 1; i <= n; ++i) {
int ans = 0;
for (int q = 0; q < m ; ++q)
if ((1 << q) & w[i])
--cnt[q];
for (int j = 1; j <= n; ++j) {
if (i == j)
continue;
int now = 0;
for (int q = 0; q < m ; ++q)
if ((1 << q) & w[j] && (cnt[q] - 1) >= (n >> 1) - 1)
++now;
ans = max(ans, now);
}
for (int q = 0; q < m ; ++q)
if ((1 << q) & w[i])
++cnt[q];
cout << ans << '\n';
}
return 0;
}
if (m <= 10) {
return 0;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
Output is correct |
2 |
Incorrect |
1 ms |
464 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
Output is correct |
2 |
Incorrect |
1 ms |
464 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
Output is correct |
2 |
Incorrect |
1 ms |
464 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |