How many structures need quick solution. I worked with segments [i,j] on [1,N] and used 1: short num[50000] for quicksort of segments; 2: short prev[50000] for fathes of segments. Segment I is father of segment J if I smallest segment containing J. 3: vector<short>sons[50000] for sons of segments. Last structure very slow and I had bad Ac time 0.95.
Extra strange! First test is sample, my CORRECT program passes it (with many others) on my computer, and gets WA #1 on timus... I've initialized all variables. Where is problem - in compiler, validator or (???) my code?