The 13th Chinese Northeast Contest--H. Skyscraper(树状数组+线段树)
AtthemainstreetofByteland,therewillbebuiltnskyscrapers,standingsequentiallyonenexttoother.Iflookleftsideright,sequenceoftheirheightwillbea1,a2,...,an.Initiallythestreetisempty,everyskyscraper’sheighti