用户输出
0
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#25964 | #1150. 1-01F.czq的疑惑矩阵 | Accepted | 100 | 5006 ms | 66000 K | C++ 11 / 896 B | 丁丁跑卡车 | 2020-06-29 18:01:56 |
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MAX_INF 0x3f
#define MAX_INF_VAL 0x3f3f3f3f
#define MAX_INF_VAL_LL 0x3f3f3f3f3f3f3f3f
#define pi 3.141592653589
#define eps 1e-6
//#define p 2173412051LL
//#define sz 2
using namespace std;
int res[17000000];
int a[24][24];
int f[24];
int main() {
int n, m;
int ans = MAX_INF_VAL;
int x, y, z;
scanf("%d%d", &n, &m);
x = (1 << m) - 1;
for (int i = 0; i <= x; ++i) res[i] = __builtin_popcount(i);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
scanf("%d", &a[i][j]);
f[i] <<= 1;
f[i] |= a[i][j];
}
}
for (int i = 0; i <= x; ++i) {
y = 0;
z = x ^ i;
for (int j = 0; j < n; ++j) y += min(res[i ^ f[j]], res[z ^ f[j]]);
ans = min(y, ans);
}
printf("%d", ans);
return 0;
}
用户输出
4
系统信息
Exited with return code 0
用户输出
5
系统信息
Exited with return code 0
用户输出
5
系统信息
Exited with return code 0
用户输出
5
系统信息
Exited with return code 0
用户输出
0
系统信息
Exited with return code 0
用户输出
0
系统信息
Exited with return code 0
6 10
1 1 0 1 0 1 1 1 1 0
1 1 0 1 0 0 0 1 1 1
1 0 0 1 1 0 0 0 1 0
0 1 1 1 0 0 1 0 0 0
1 1 0 1 1 1 1 1
<25 bytes omitted>
用户输出
14
系统信息
Exited with return code 0
6 10
0 0 0 0 0 1 0 0 0 1
0 0 0 1 0 1 0 1 0 0
0 1 1 0 0 0 0 1 1 0
0 0 1 0 0 0 1 0 1 0
1 1 0 1 1 1 1 1
<25 bytes omitted>
用户输出
16
系统信息
Exited with return code 0
8 10
1 1 1 0 0 1 0 1 0 0
0 0 1 0 1 0 0 0 1 1
0 0 0 1 1 1 1 1 0 0
1 1 0 1 0 0 0 1 0 0
1 0 1 0 0 0 0 1
<65 bytes omitted>
用户输出
23
系统信息
Exited with return code 0
15 18
0 1 1 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0
0 1 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1
1 0 1 1 0 0 0 1 1 1 1
<446 bytes omitted>
用户输出
82
系统信息
Exited with return code 0
24 2
0 0
0 0
0 0
0 1
1 1
1 0
1 1
1 0
1 1
0 1
0 1
0 0
1 0
1 1
0 1
1 1
1 1
0 0
1 1
1 1
0 1
1 1
1 0
1 1
<1 byte omitted>
用户输出
9
系统信息
Exited with return code 0
19 5
1 1 1 0 1
0 0 1 1 1
1 0 1 0 1
0 1 0 0 1
1 0 1 0 1
0 0 1 1 1
1 0 0 0 0
0 1 1 0 0
0 0 0 0 1
0 0 0
<95 bytes omitted>
用户输出
27
系统信息
Exited with return code 0
19 9
0 1 1 1 0 1 1 0 0
1 0 1 0 1 0 1 1 1
0 1 1 0 1 1 1 1 1
1 0 0 0 1 0 1 1 0
1 0 1 1 0 0 1 0 1
1 1 0
<247 bytes omitted>
用户输出
51
系统信息
Exited with return code 0
21 2
0 0
0 0
1 1
1 0
0 1
1 1
0 1
0 0
1 0
0 1
0 0
0 0
1 1
0 1
1 0
0 0
0 0
0 1
0 0
0 1
1 1
用户输出
9
系统信息
Exited with return code 0
24 24
1 1 0 0 0 0 0 0 1 1 1 0 0 1 1 1 0 1 0 1 1 0 0 0
0 1 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 1 1 1
<1058 bytes omitted>
用户输出
207
系统信息
Exited with return code 0
24 24
0 0 0 0 0 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1
0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 1 0
<1058 bytes omitted>
用户输出
207
系统信息
Exited with return code 0
24 24
0 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 1 1 1
0 0 0 0 0 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0
<1058 bytes omitted>
用户输出
203
系统信息
Exited with return code 0
24 24
0 1 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 0 1 1 0 1 1 0
1 1 1 0 1 0 0 0 0 0 1 1 1 1 1 0 1 1 1 1 0 1 0
<1058 bytes omitted>
用户输出
203
系统信息
Exited with return code 0