On-Call Team

시간 제한1초메모리 제한2048 MB

요약
각 엔지니어가 익힌 서비스 집합이 주어질 때, 어떤 k개 서비스가 동시에 고장 나도 서로 다른 엔지니어가 맡을 수 있는 최대 k를 구한다.
난이도

어려움10점 중 8점

유형
조합론, 비트 연산, 완전 탐색, 그래프
정답자
아직 제출이 없습니다

문제

An IT company has formed an on-call team of software engineers who will manage their backend services and make sure that these services run without interruption. When services go down, for each service that is down the on-call team must dispatch one member who is familiar with that service to take care of its issue. One team member can handle at most one service at a time. The company wants to evaluate the robustness level of the on-call team, which is defined as the maximum value kk such that any kk services that go down simultaneously can be handled by the on-call team.

입력

The first line of input contains two integers nn (1≤n≤3⋅1041 \leq n \leq 3 \cdot 10^4) and mm (1≤m≤201\leq m \leq 20), where nn is the number of engineers and mm is the number of backend services.

Each of the next nn lines contains a string of binary digits of length mm, describing the nn software engineers' familiarity with the mm services. The jthj^{\text{th}} digit on the ithi^{\text{th}} line is 11 if software engineer ii is familiar with service jj, and 00 otherwise.

It is guaranteed that for each of the mm services there exists at least one software engineer who is familiar with it.

출력

Output a single integer, which is the robustness level of the on-call team.

예제2

  1. 예제 1

    입력
    4 6
    001101
    111001
    001110
    100100
    
    예상 출력
    3
    
  2. 예제 2

    입력
    3 3
    001
    001
    110
    
    예상 출력
    1