VSN - Editorial

I used the same approach as mentioned in the editorial using python 3.
I am getting TLE for 6 out of 7 tasks.

The link for the code is:

  • https://ideone.com/IZ6ikK
  • Could anyone please check and see whats wrong with my code.
    It will be of great help. Thanks!!

    1 Like

    Refer to the 1st comment in the thread. You can also refer to this blog on codeforces.

    @zymbio, I saw your solution and it is totally correct. It will TLE just because python is slow. Try submitting in “pypy” or using the number of iterations as 75 (finding the exact number of iterations has been added as link in the editorial)

    1 Like

    sure! will also go through the link :slight_smile: thanks !!

    @p1p5_5 I implemented the same idea. You can see the solution here
    https://www.codechef.com/viewsolution/18824486

    Hello @saurav96 here is your accepted code:Link The only problem was precision since you had used float it was resulting to less precision. Use double or long double to resolve. You can also see this link for more info:gfg

    hello,

    can someone help me understand this concept.

    i want to use this formula as…
    |PC X PQ| / |PQ| = R

    so does PC represents C(x,y,z) - P(x,y,z) ?
    if so…
    how to get values for a,b,c using numerator |PC X PQ| ??
    please help.

    Thanks.

    Time Complexity O(1) per test case reminds me of https://codeforces.com/blog/entry/58667 xD

    What? I think I edited that section out for correction xD. Where is it left now? :stuck_out_tongue:

    PS: Great blog you found :stuck_out_tongue: