Pertozavodsk Winter Training Camp 2016-Problem J. Sort It!
Timelimit:1.5secondsMemorylimit:512mebibytesYouaregivenapermutationoflengthn:p1p_{1}p1,p2p_{2}p2,...,pnp_{n}pn.Considersomearrayoflengthnconsistingofintegersbetween1andn(equalelementsareallowed).Letus