Contest - 7 Hints to Problems [OFFICIAL]

your are evaluating same values again for the test cases. You can calculate them before taking the input and then output the query.

1 Like

Can anyone tell what is wrong with this sorting technique for solution to FROGV?

https://www.codechef.com/viewsolution/36067280

https://www.codechef.com/viewsolution/36889804

Can anyone see why am I getting WA for KPRIMES?

bro just find score vector elements value outside while loop

AC

Think of the for loop at line number 12 … You have counter for those primes which are <=sqrt(100005) … But there are more primes after sqrt(100005) and you are not counting these primes… The primes after the sqrt(100005) have one prime factor … But you didn’t track it

3 Likes

Yeah I already figured that out. But thanks for the help anyways!

Can anyone help me out finding the cause of having RTE for the problem #FROGV

https://www.codechef.com/viewsolution/37063021

  1. Subtraction Game 2 - AMSGAME2

Hint 3 ?

Can anyone help me finding the mistake in BILLIARDS problem its giving wrong ans
CodeChef: Practical coding for everyone

try printing the value of N in your program then see why it happened :smiley: .

For the Hint 4 in 10.Construct Array solution, the author might have meant matrix exponentiation instead of matrix multiplication, similar to Fibonacci numbers solution in O(Logn) time.

1 Like

Hello
Question 1:- Count SubArrays
Can you please explain why it is failing one test case
https://www.codechef.com/viewsolution/39067206

For the Hashing problem ,will it not be better to use 3d dp? dp[i][j][k]:- where i is the length of string starting from ‘a’+i th character, j is the sum and k is the length.I found it to be more intuitive. I am not able to figure out the knapsack one.

Reminder: use MOD value as 10e9+9 instead of usual 10e9+7 in Billiards question. I took a lot of time figuring that out :sweat_smile:.

I don’t know if it’ll help now, but it’s failing because you declared the answer as int while the actual answer can be more than the maximum value of what int can store. So just change int to a suitable data type that can store the answer ( long long ) and it’ll be alright.

1 Like

can anyone find out why my solution gives TLE
https://www.codechef.com/viewsolution/47355291

No one has got right answer for this problem in python language

i also did the same way as you
https://www.codechef.com/viewsolution/47342345

Can someone please figure out my mistake in FROGV
https://www.codechef.com/viewsolution/48753538