About June Long Challenge - Math-Contest

Solution as in editorial or code ?

No code. Just the approaches. Thats enough though.

Yes. As a matter of fact, admins should check out cplusplus forums. People literally have such wonderful group discussions there. wtf !

1 Like

Yeah. I agree with you. 6 questions in Div 2 are purely based on pattern observation. Where LENTMO seemed tough initially but then doing subtask 2 first helped me understand how to go about it and got to know that even this question is pure maths and pattern observation based.
Also, COOLCHEF was all about using Dictionary and its proper implementation.

Can you provide the link for INTRPATH ?

Not here. Can you give me your cf handle or fb id? I’ll message you there :slight_smile:

Nopes. Coolchef’s intended solution is not using dictionary. Many brute force-python solutions also got AC cuz of weak cases and a very big Time Limit.

The contest is over. What is the problem posting it here :roll_eyes:

1 Like

What I did was storing values of only repeated element on every index. For e.g. l=[1,1,1,3,2,2] my list of dictionary was [{1:1},{1:2},{1:3},{1:3},{1:3,2:1},{1:3,2:2}]. Not including 3 as it’s frequency was 1 (reason- while calculating permutations, we only need count of repeating elements). Even I tried the brute force firstly but only subtask 1 got correct, others were getting TLE. And the time given for Python submissions is 10 seconds/file (I think) which is double of what is usually given for Python (5 seconds/file). C/C++ is given 5 seconds/file.

He is the author of INTRPATH. Give him the link. He can help out to stop these things. Cheating is clearly not acceptable.

Well, I realized that I don’t have the link as I did not save it, it is from c-plus-plus.com .
I’ll post it here when I find it.

Yeah please do !!!


I think this is the thread as mentioned by @anon55659401

1 Like

LCA and also about the proper concepts of tree…

I think you Google long challenge instead of solving it :stuck_out_tongue::joy:


Your solution for FGTREE ?

I did not submit it but have an idea. For n less than 20 we can find the root and then devide the array into two parts and continue doing it until leaf is reached ( a recursive way).
For n less than 100 I think we can find the leaf nodes and then join them to find their parent and then join them until root is found out .

Oops is it that simple !!
I regret not thinking much :slightly_frowning_face:

what ??..but why my solution gives TLE…it is also O(nq) its just annoying me

Just O(nq) will not work, you have to do some optimizations too.