| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 3 초 | 1024 MB | 93 | 33 | 28 | 49.123% |
In the council of JOI City, there are $N$ assembly members, numbered from 1ドル$ to $N$. The council will open a meeting, and the assembly members will take votes on $M$ proposed ordinances, numbered from 1ドル$ to $M$. If $A_{i, j} = 1,ドル the assembly member $i$ (1ドル ≤ i ≤ N$) will cast an affirmative vote on the proposed ordinance $j$ (1ドル ≤ j ≤ M$). If $A_{i, j} = 0,ドル the assembly member $i$ will cast a negative vote on the proposed ordinance $j$.
The council of JOI City will be performed as follows.
Mayor K, the mayor of JOI City, wants the council to approve as many proposed ordinances as possible. Mayor K collected information on assembly members. Mayor K knows, on each proposed ordinance, who will cast an affirmative vote and who will cast a negative vote.
Write a program which, given information of the votes of the assembly members, calculates, for each assembly member, the maximum possible number of proposed ordinances approved by the council if that assembly member is chosen as the chairperson.
Read the following data from the standard input.
$N$ $M$
$A_{1,1}$ $A_{1,2}$ $\cdots$ $A_{1,M}$
$A_{2,1}$ $A_{2,2}$ $\cdots$ $A_{2,M}$
$\vdots$
$A_{N,1}$ $A_{N,2}$ $\cdots$ $A_{N,M}$
Write $N$ lines to the standard output. The $i$-th line (1ドル ≤ i ≤ N$) of output should contain the maximum possible number of proposed ordinances approved by the council if the assembly member $i$ is chosen as the chairperson.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 8 | $N ≤ 300$. |
| 2 | 8 | $N ≤ 3000$. |
| 3 | 6 | $M ≤ 2$. |
| 4 | 19 | $M ≤ 10$. |
| 5 | 15 | $M ≤ 14$. |
| 6 | 22 | $M ≤ 17$. |
| 7 | 22 | No additional constraints. |
3 3 1 0 0 1 1 0 1 1 1
3 3 2
This sample input satisfies the constraints of Subtasks 1, 2, 4, 5, 6, 7.
4 12 1 1 1 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 0 0 0
5 4 6 6
This sample input satisfies the constraints of Subtasks 1, 2, 5, 6, 7.
16 4 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1
3 3 3 2 3 2 2 1 3 2 2 1 2 1 1 0
This sample input satisfies the constraints of Subtasks 1, 2, 4, 5, 6, 7.
4 2 1 0 0 1 1 1 1 1
2 2 1 1
This sample input satisfies the constraints of all the subtasks.
Camp > JOI Spring Training Camp > JOI 2022/2023 Spring Training Camp 2-2번
Camp > JOIG Spring Training Camp > JOIG 2022/2023 Spring Training Camp 1-3번