Feedback for Encoding OCT 19

Our Codechef Campus Chapter Team (Netaji Subhash Engineering College) has been hosting Encoding for over a year and we do it almost every month in Codechef. We try to keep the questions balanced such that from newbies to pros :stuck_out_tongue:, everyone find it educational.

We would really like to here from the community.
Any feedback is accepted. We will try to improve as well.

Link - https://tiny.cc/enoc2019
For updates, you can follow us at : here

5 Likes

This is regarding the question GVR, can anyone explain me, https://www.codechef.com/viewsolution/27634356
How this solution got accepted under the constraints mentioned in the question?

1 Like

Have a look at this solution bro.
:upside_down_face:

2 Likes

This is because of very less no of primes were present in test case with higher value. This is the reason that many of you got AC even with O(NSqrt(N)), but it appears nearly equal to O(N). The perfect solution for this problem will be Miller Rabin Primality Test for checking prime, then its complexity in that case will be O(N*(lnN)^2)

Wow, and I thought O(n*sqrt(n)) was the worst thing :slight_smile:

1 Like

Thank you for clarifying, but I wanted to stress upon the fact that the test cases are pretty weak, since these kinds of solutions are getting ACed.

1 Like

What the heckk!! Did that solution passed :frowning::frowning:

Yup. It did. I was going through the accepted solutions to know how to solve this when I encountered this.

2 Likes

Why did my submission with fast IO give WA but same solution with cin cout give AC.
https://www.codechef.com/viewsolution/27627411 WA Solution
https://www.codechef.com/viewsolution/27629058 AC Solution

1 Like

Because of errors in input file??? Its a common issue thats why u dont use fast io :frowning_face: :frowning_face:

I dont use fast IO generally but i copied dsu on tree code from a previous submission.

2 Likes

that’s what you get for copying

2 Likes

:man_facepalming:

2 Likes

The best part is that the check(int N) function must be check(long long N). The guy was real lucky.

1 Like

can u explain what logic he has used in this code…

Editorials will be uploaded soon.

2 Likes

Is this contest(Encoding) rated ?

Encoding is a monthly organised contest of Netaji Subhash Engineering College,and it is not rated☺️

can anyone explain the CORRECT solution for the problem GVR which follow the constraints and passes within the given time limit…

The perfect solution for this problem will be Miller Rabin Primality Test for checking prime, then its complexity in that case will be O(N*(lnN)^2)O(N∗(lnN) 2)

1 Like