CHANDF - EDITORIAL

Can you clarify the need of using double in Java to solve it?

@harshil21 code link : CodeChef: Practical coding for everyone

checked all the cases mentioned in the thread working fine for all
Please share the missing case

Just work on these, you’re very close.

3
19377283 19368100 30890 31436
23962289 7250321 22993 23560
11014 21047686 21058127 21061591

Answers:

30895
23473
21060486

When i brute force all the bits , the value of product is exceeding 2^64 thus resulting in a long overflow, that’s y :confused: am able to pass subtask 1 and 2 but getting WA and TLE for subtask 3 alone . :confused: @harshil21

Here is my solution link
https://www.codechef.com/viewsolution/33177144

handled those cases still missing something
code link : CodeChef: Practical coding for everyone

2
2369383 11351335 17317 26860
20186496 20195266 20218112 20226640

Now, try generating some random cases on your own and check with the brute force solution to check for answers.

No, your code is missing some other cases, the error is not of overflow.
Try generating random cases and compare with brute force solution.

1 Like

Yes @harshil21, i found that mistake and rectified ,now all the testcases mentioned in the above comments are getting passed still am getting a WA and TLE in subtask 3 :confused:

Here is my solution link ,
CodeChef: Practical coding for everyone @harshil21

Even these cases are passed … :confused:

Same here @redoc_007 u got it now ?

use this CHANDF - EDITORIAL - #208 by akshitm16

But i coded in java :confused: @redoc_007 all the test cases mentioned above got passed still am getting WA and TLE idk why :confused:

CodeChef: Practical coding for everyone , here is my solution link @harshil21 @redoc_007 :confused:

Use a random test case generator as mentioned in the code. Create your own…idk java.

2 Likes

will try thanks.

Nice question which had my week time in 10 days of long challenge and also really nice logic. :wink:

1 Like

@harshil21

Why is it failing in subtask-2

Link

Try the cases near the limits as discussed above and hopefully you’ll find your mistake.

Tried everything mentioned.

I am surprised. Your code is passing every test case as tested by random test case generator. I’ve tested your code for many cases. It passes everything.

1 Like