How this solution works ? (Gold Mining , LTIME85 , Weak TC ? )

You didn’t output with enough precision, or the bigger numbers got printed in scientific notation.

1 Like

The TL was tight to cut off the map solutions I guess.

1 Like

i forgot using precision .:frowning: and got WA on this with same solution

So, i need to even output even trailing zeros

K

see my all solutions

This is correct, I dont understand why this is optimal…

1 Like

Bro can u explain why this is optimal ?

You prove it by contradiction.

WHAT??? This was literally the first thing I tried and I got WA, can someone help why am i getting WA?
https://www.codechef.com/viewsolution/34752778

LMAO use set precision :slight_smile:

No, it’s not about trailing zeros. Default precision for cout << is 6 significant digits, so it could be wrong on borderline cases (I think). Also the grader might not accept scientific notation which by default is used for large floating point numbers.

Umm, what is “ABC”?

Atcoder Beginner Contest (ABC)

1 Like

auto F() {

ll n;

cin>>n;

long double as=0,bs =0;

while(n--) {

    cin>>g>>a>>b;

    as += b * ( g/ (a+b));

    bs += a * ( g/(a+b));

}

cout<<as<<" "<<bs;

return "";

}

this is my code everything is same except the precision part it got WA. Can someone explain why it got WA.
https://www.codechef.com/viewsolution/34819585

If u print long double values always print at least 6 digits after decimal like this -

cout<<fixed<<setprecision(6)<<value;

@zod_01

You have used map in your last solution which increases the complexity, also don’t be offended but that’s lot of code. I mean the get_hash function was never required. Here is my full solution if you want to compare.

yes, but in question they didn’t mention to print upto six decimal places it was mentioned that relative error must not exceed 10^-6. So where does it go wrong

When i set precision to 10 now it says correct answer.Thank you.

please see all my submissions that is I applied binary search too. using adjacentcy lists
I used map only after my submission based on binary search was TLED.