https://www.codechef.com/ide …
This is the code, kindly tell the improvement
Only 1 test case is passing
Okay saved it! Kindly check
Rectify these:
- Don’t use pow() function as overflow can occur (think if mid = 10^6 and k=100)
instead multiply using loop and check if overflow can occur! - don’t have to use double (long long is good), still floor(ans) is to be used (say ans is 4.3 then print 4 and not 5!)
How do you the access the saved code on this ide? I can not see my previously saved code?
I solved the question though, with the loop instead of pow(). Thanks!
I saw your submissions for the problem