MULTQ3 help

dear all need a little help over a code of link text my code is link text
don’t know where the bug is

Input

7 8
1 0 6
0 0 5
0 0 4
0 0 3
0 0 2
0 0 1
0 0 0
1 0 6

and your output is

7
2

it has to print 7 and 3 - http://ideone.com/M1EJD9

@betlista your link is working fine for me and input kind is ok too
the above is showing something wrong it is N, Queries where we have to show when query start with 1 and it is showing hat at ideone

Sorry for the first wrong try, I edited the test case, hope it’s correct this time :wink:

thanks @betlista for your test case got the bug
a new request help me to get over TLE how could it so happen

hey @betlista could u help me with FAST/IO in cpp I actually applied that but still TLE and I 've sure I implemented segmented tree only

fast I/O is not your problem for sure, you are using scanf and printf a those are quick enough probably some operations with tree are not quick enought, try to analyze it and find worst case…

so u meant that operation beneath node transfer are time consuming
the problem occurs with the too many function calls and object transfer

//