You are viewing a single comment's thread. Return to all comments →
SELECT CAST( ROUND(ABS(MAX(LAT_N)- MIN(LAT_N)) + ABS(MAX(lONG_W) - MIN(LONG_W)),4) AS DECIMAL(18,4) )AS manhattan FROM STATION;
REASON:
CAST(... AS DECIMAL(18,4)) → forces SQL to store and return the number as a fixed-point decimal with exactly 4 digits after the decimal point.
DECIMAL(18,4) means: up to 18 total digits, 4 after the decimal.
So the output is guaranteed to look like 259.6859 (not 259.685900000).
Now the judge sees exactly the expected format → ✅ accepted.
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 18
You are viewing a single comment's thread. Return to all comments →
SELECT CAST( ROUND(ABS(MAX(LAT_N)- MIN(LAT_N)) + ABS(MAX(lONG_W) - MIN(LONG_W)),4) AS DECIMAL(18,4) )AS manhattan FROM STATION;
REASON:
CAST(... AS DECIMAL(18,4)) → forces SQL to store and return the number as a fixed-point decimal with exactly 4 digits after the decimal point.
DECIMAL(18,4) means: up to 18 total digits, 4 after the decimal.
So the output is guaranteed to look like 259.6859 (not 259.685900000).
Now the judge sees exactly the expected format → ✅ accepted.