Add a nice AC code from Internet.
Elegant code with STL. Useful unique(BI, EI) and distance(BI, EI) in <algorithm>.
For sorted data, we usually have to find linear or sublinear algorithms.