Helping Hands

i just tested i am getting 3

before changing the code or after changing it?

i copy pasted my submission and tested with N=4 i got 3 as output

Please help where i am getting WA

Link to solution:
https://www.codechef.com/viewsolution/36694740

let me check ur code once

Thank you very much for the tip

1 Like

np bruh

1 Like

Dementia rated contest - #2 by therealnishuz check this guy’s solution

i ran your code on my local machine, it is giving me 4 as output for 4

Read but not able to figure out where i am wrong!!!

Yes you are right.
Minimum steps required is k+n-4 where k = number of primes <= n.

This problem is similar to the GOSSIP problem: https://www.math.uni-bielefeld.de/~sillke/PUZZLES/gossips.pdf

@admin look at this

bruh its different question in the article, f(3)=2, f(4)=3 in our case and it is not f(3)=3,f(4)=4
so they aren’t the same

Can anyone please explain how is the answer prime[n]+n-3?

In this discussion we are telling that it is not working bruh, but if u still want to know the answer here it is Helping Hands - #33 by sixofdiamonds