시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 256 MB | 389 | 202 | 159 | 57.401% |
Define the complexity of a string to be the number of distinct letters in it. For example, the string string
has complexity 6 and the string letter
has complexity 4.
You like strings which have complexity either 1 or 2. Your friend has given you a string and you want to turn it into a string that you like. You have a magic eraser which will delete one letter from any string. Compute the minimum number of times you will need to use the eraser to turn the string into a string with complexity at most 2.
The input consists of a single line that contains a single string of at most 100 lowercase ASCII letters (‘a’–‘z’).
Print, on a single line, the minimum number of times you need to use the eraser.
string
4
letter
2
aaaaaa
0
uncopyrightable
13
ambidextrously
12
assesses
1
assassins
2
ICPC > Regionals > North America > Pacific Northwest Regional > 2015 Pacific Northwest Region Programming Contest > Division 2 P번
ICPC > Regionals > North America > Southeast USA Regional > 2015 Southeast USA Regional Programming Contest > Division 1 I번
ICPC > Regionals > North America > Southeast USA Regional > 2015 Southeast USA Regional Programming Contest > Division 2 J번