Comments
On EgorCHelper 2.4, 11 years ago
0

It's working for me i just changed the Chelper dependency scope from "Provided" to "Compile"

Actually if the ith loop is written first and then the jth(logN one) then, Suppose if you are computing the value for i = 0, j = 2 and U[i][1] = 2 then for computing the value for U[0][2] you need the value for U[2][1] which is not computed until now.
while exchanging both the loops it won't be a problem as all the values of U[i][1] is already computed for i in range(0,n-1).

The updated query is picked up directly from the LCA tutorial of topcoder :)

I just reviewed your code which uses a stack.
There's no problem with your stack implementation, it is with your build part for 2^j interval breakdown. See this Updated Code ,I just exchanged the position of for loop for (i,j)

P.S -> I prefer doing query with something like this Updated Query

Can you explain your logic behind E ??

At each child j, you have the option to select (0,1,2....F(j)) valid sets from subtree rooted at j. Hence F(i) = prod(F(j)+1)

It's the same as the proof of finding no of divisors of any number using prime factorization where,
if n = a^x * b^y * c^z, no of divisors = (x+1)(y+1)(z+1). Proof
Try to relate this to the no of divisors problem, you will find your answer :)

it seems codeforces is improving my english too.
Xellos thanks for the reply :)

Thanks.
the problem statement was not clear :(

In problem "Laundry" , what this statement actually meant :- clothes belonging to different persons may not be fastened with clothespins of the same color ??
Does this mean that we cannot assign same color clothespins to different persons ??

On JahidBinary Index Tree, 12 years ago
+1

See this link , for understanding various usage of BIT.
http://zobayer.blogspot.in/2013/11/various-usage-of-bit.html

For problems, follow this link :-
http://ahmed-aly.com/Category.jsp?ID=26

On haguGym problem , 12 years ago
0

This problem asks you whether there is a way to reach the end point from the starting point without being detected.

You can make at most v moves during day or night. In each move you can move to adjacent cell (left,right,top,down).

If you move during the day you can move from one 'F' to another 'F' only, since forest provides you cover, while during night you can move anywhere since the night provides you cover. It doesn't matter how many days or night you take to reach the end point.

You can try this problem Unlucky Strings This problems uses Matrix exponentiation + KMP.

On haguGym problem , 12 years ago
0

No, I'm not able to do that either.

But I just wanted to ask , how am I supposed to know that these type of solutions will pass or am I supposed to just go with my intuition.

On gridnevvvitCodeforces Round #275, 12 years ago
+5

ohh, i think like adamant , feeling proud of myself :P

On gridnevvvitCodeforces Round #275, 12 years ago
+9

sorry, seems i commit mistakes even after the contest.

On gridnevvvitCodeforces Round #275, 12 years ago
+10

I solved it using segment trees (sadly after the contest).

Initially set all the values to 0 and the if a query(L,R,V) comes, update all the values in the range(L,R) with (a[i] = a[i] | V where L <= i <= R).
while joining nodes in the segment tree do seg[node] = seg[2*node] & seg[2*node+1] and finally check for each query_range whether the bitwise and (&) of all the values equals to the required value i.e check value(L,R) = V . This got AC .

0

thanks ikbal got AC with automation method too :)

0

Great info, will remember to use it the next time :) Thanks

thanks mnbvmar and Elk-Cloner. :)

can you explain to me your computation analysis of why it won't fit inside long long range. If you can, provide me the link to your big integer implementation.

P.S -> I tried using unsigned long long too , still the same result.

On haguTIMUS 1713 : Key Substring, 12 years ago
+3

Thanks a lot for the suggestion. I was able to figure out my mistake by generating random cases . :)

Got it . Thanks :)

Thanks for the explanation.

I still haven't been able to understand the problem statement of problem E. So please explain what are we supposed to do in case of a query of Type 2 ? :(