Znanstvenik
의견: 0
In this economy, we all know how hard it is to get a job. Mirko, a recent college graduate, however, got lucky — he is now employed as a runeologist by the Language Institute of Croatia. His friend Slavko believes runeology isn't a science and is hence angry at Mirko for believing the opposite. One foggy Christmas day, Mirko's laptop broke. Since he isn't great with computers, he gave it to Slavko to repair it. Slavko, feeling a little naughty, decided to mess up a particular file Mirko was working on.
This file contains a matrix of \(R\) rows and \(C\) columns. Each element of the matrix is a single letter. No two columns of the matrix are equal. To have some fun with pseudo-scientist Mirko, Slavko decided he will delete as many rows as possible from the top of the table, without breaking the no-equal-column rule.
The first line of input contains two integers \(R\) and \(C\) (\(2 \le R, C \le 1000\)), the number of rows and the number of columns, respectively.
In each of the next \(R\) lines there are \(C\) lowercase letters of the English alphabet. These \(R \times C\) letters represent Mirko's table (which does not have two equal columns).
Output a single integer, the maximum number of rows which can be deleted from the top of the table
so that no two columns are equal.
EXAMPLE TEST DATA
input
2 6
dobarz
adatak
output
0
input
3 4
alfa
beta
zeta
output
2
input
4 6
mrvica
mrvica
marica
mateja
output
1
| 서브태스크 | 점수 | 설명 |
|---|---|---|
Test 1 | 10점 | None |
Test 2 | 10점 | None |
Test 3 | 10점 | None |
Test 4 | 10점 | None |
Test 5 | 10점 | None |
Test 6 | 10점 | None |
Test 7 | 10점 | None |
Test 8 | 10점 | None |
Test 9 | 10점 | None |
Test 10 | 10점 | None |
2 6
dobarz
adatak03 4
alfa
beta
zeta24 6
mrvica
mrvica
marica
mateja1평가 및 의견
Znanstvenik
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Znanstvenik