oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

jobs Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

statement.html

Problem Description

Peanut has N employees, and M tasks that he wishes to assign to them. Each employee can only handle one task, and since not everyone is equally competent, not every employee can do every task. Help Peanut figure out what is the maximum number of tasks he can assign to the employees, if he assigns these tasks optimally.

Input

The first line of input will contain two integers, N and M.

The next N lines of input will contain M integers each. The jth integer on the ith line will be 1 if employee i can complete task j, and 0 otherwise.

Output

The output should contain exactly one integer, the maximum number of tasks Peanut can assign to the employees.

Limits

1 ≤ N, M ≤ 1000.

Sample Input

4 4
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1

Sample Output

3

Tags

Graph Theory, Maximum Cardinality Bipartite Matching, Classic

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
1100161s256MBMinimum

Judge Compile Command

g++-8 ans.cpp -o jobs -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.