Output the minimum number of distinct item types.
6 5 1 3 3 2 2 3 3 1 2 5 5 4
4
The cows need at least 444 different labels: first exchange 111 for 333, then 333 for 222, and finally 222 for 555.
1≤N≤5×1041\le N\le 5\times 10^41≤N≤5×104, 1≤K≤1031\le K\le 10^31≤K≤103.
Translated by ChatGPT 5
注册一个 云斗学院 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 云斗学院 通用账户