SEAGM2 - Editorial

@amaneureka Nice idea, but the following test case should not work:

2 10000

0.0001 0.0001 … (5000 times) 0.9999 0.9999 0.9999 … (5000 times)

0.9999 0.9999 0.9999 … (5000 times) 0.0001 0.0001 … (5000 times)

+1 for the variable names.

2 Likes

@spagiarri Here :slight_smile:alt text

PS: After watching your comment (at 04:00AM) from mobile, Just to prove my code I booted laptop again :stuck_out_tongue:

I can give you brief explanation that why it worked, but its 4AM and I’m very tired so, sorry :slight_smile:

@amaneureka: Sorry, I didn’t mean to not let you sleep because of my comment.
If you have time, could you swap the 3rd and the 4th ‘for’ loop? The idea of my test case was that (0.0001/0.9999)^5000 would be 0 because of the precision and that multiplying back by (0.9999/0.0001)^5000 cannot change that. (For example http://paste.ideaslabs.com/show/CvvvJDHinq returns 0 and 0 in Java).

Why dies my solution passes the subtask 2 but now 1? In JAVA
Link : link text