#include <bits/stdc++.h>
using namespace std;
const int nx=3e5+5, mx=11;
int n, m, sm[mx], a[nx][mx], msk[nx], cnt[(1<<mx)+5], res[nx];
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n>>m;
for (int i=1; i<=n; i++) for (int j=0; j<m; j++) cin>>a[i][j], sm[j]+=a[i][j], msk[i]+=a[i][j]*(1<<j);
for (int i=1; i<=n; i++) cnt[msk[i]]++;
for (int i=1; i<=n; i++)
{
cnt[msk[i]]--;
for (int j=0; j<(1<<m); j++)
{
if (cnt[j]==0) continue;
int tmp=0;
for (int k=0; k<m; k++) if ((sm[k]-a[i][k]-((j&(1<<k))>0))>=n/2) tmp++;
res[i]=max(res[i], tmp);
}
cnt[msk[i]]++;
}
for (int i=1; i<=n;i ++) cout<<res[i]<<'\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
464 KB |
Output is correct |
2 |
Correct |
37 ms |
17416 KB |
Output is correct |
3 |
Correct |
40 ms |
17276 KB |
Output is correct |
4 |
Correct |
31 ms |
16688 KB |
Output is correct |
5 |
Correct |
44 ms |
17236 KB |
Output is correct |
6 |
Correct |
32 ms |
16732 KB |
Output is correct |
7 |
Correct |
44 ms |
17232 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
464 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
600 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
464 KB |
Output is correct |
2 |
Correct |
37 ms |
17416 KB |
Output is correct |
3 |
Correct |
40 ms |
17276 KB |
Output is correct |
4 |
Correct |
31 ms |
16688 KB |
Output is correct |
5 |
Correct |
44 ms |
17236 KB |
Output is correct |
6 |
Correct |
32 ms |
16732 KB |
Output is correct |
7 |
Correct |
44 ms |
17232 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
464 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
600 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1093 ms |
22064 KB |
Output is correct |
21 |
Correct |
614 ms |
21600 KB |
Output is correct |
22 |
Correct |
618 ms |
21584 KB |
Output is correct |
23 |
Correct |
223 ms |
22272 KB |
Output is correct |
24 |
Correct |
220 ms |
22100 KB |
Output is correct |
25 |
Correct |
3559 ms |
22096 KB |
Output is correct |
26 |
Correct |
3566 ms |
22096 KB |
Output is correct |
27 |
Correct |
0 ms |
352 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
464 KB |
Output is correct |
2 |
Correct |
37 ms |
17416 KB |
Output is correct |
3 |
Correct |
40 ms |
17276 KB |
Output is correct |
4 |
Correct |
31 ms |
16688 KB |
Output is correct |
5 |
Correct |
44 ms |
17236 KB |
Output is correct |
6 |
Correct |
32 ms |
16732 KB |
Output is correct |
7 |
Correct |
44 ms |
17232 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
464 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
600 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1093 ms |
22064 KB |
Output is correct |
21 |
Correct |
614 ms |
21600 KB |
Output is correct |
22 |
Correct |
618 ms |
21584 KB |
Output is correct |
23 |
Correct |
223 ms |
22272 KB |
Output is correct |
24 |
Correct |
220 ms |
22100 KB |
Output is correct |
25 |
Correct |
3559 ms |
22096 KB |
Output is correct |
26 |
Correct |
3566 ms |
22096 KB |
Output is correct |
27 |
Correct |
0 ms |
352 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
46 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
47 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
464 KB |
Output is correct |
2 |
Correct |
37 ms |
17416 KB |
Output is correct |
3 |
Correct |
40 ms |
17276 KB |
Output is correct |
4 |
Correct |
31 ms |
16688 KB |
Output is correct |
5 |
Correct |
44 ms |
17236 KB |
Output is correct |
6 |
Correct |
32 ms |
16732 KB |
Output is correct |
7 |
Correct |
44 ms |
17232 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
464 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
600 KB |
Output is correct |
16 |
Correct |
0 ms |
344 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1093 ms |
22064 KB |
Output is correct |
21 |
Correct |
614 ms |
21600 KB |
Output is correct |
22 |
Correct |
618 ms |
21584 KB |
Output is correct |
23 |
Correct |
223 ms |
22272 KB |
Output is correct |
24 |
Correct |
220 ms |
22100 KB |
Output is correct |
25 |
Correct |
3559 ms |
22096 KB |
Output is correct |
26 |
Correct |
3566 ms |
22096 KB |
Output is correct |
27 |
Correct |
0 ms |
352 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
348 KB |
Output is correct |
30 |
Correct |
0 ms |
344 KB |
Output is correct |
31 |
Correct |
1 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
1 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
1 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
348 KB |
Output is correct |
38 |
Correct |
0 ms |
348 KB |
Output is correct |
39 |
Correct |
0 ms |
348 KB |
Output is correct |
40 |
Correct |
0 ms |
348 KB |
Output is correct |
41 |
Correct |
1 ms |
604 KB |
Output is correct |
42 |
Correct |
0 ms |
348 KB |
Output is correct |
43 |
Correct |
0 ms |
348 KB |
Output is correct |
44 |
Correct |
0 ms |
348 KB |
Output is correct |
45 |
Correct |
1 ms |
348 KB |
Output is correct |
46 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
47 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |