cf/mirror

Frequency Problem (Hard Version)

CF
1446D23000· legendary gm2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
7
1 1 2 2 3 3 3
Output
6
Sample 2of 3
Input
10
1 1 1 5 4 1 3 1 2 2
Output
7
Sample 3of 3
Input
1
1
Output
0
1446D2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)