Weather Observation Station 18

  • + 0 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.