|
|
back to boardTest 15, something strange I send program with such procedure: void moveNorth(double dist) { w += dist / rEarth * 180 / pi; if (w > 91.0) n = (n - n) / n; } And got crash 15, but when i send void moveNorth(double dist) { w += dist / rEarth * 180 / pi; } i got accepted. So, i think device can reach north pole with test 15 input data, but it's impossible. Re: Test 15, something strange In this test the device flies too close to north pole. I got AC instead WA#15 when I changed PI from 3.14159265 to 3.141592653589. And I searched for a numerical mistake for 1 hour :) Ha-ha! Edited by author 03.03.2011 23:16 Re: Test 15, something strange Posted by Solver 3 Aug 2026 10:49 acos(-1) for the most precise value of PI, but still had WA15 with this code int rlat = (int)round(lat * 180 * 1000 / pi); int rlon = (int)round(lon * 180 * 1000 / pi); while (rlon <= -180 * 1000) rlon += 360 * 1000; while (rlon > 180 * 1000) rlon -= 360 * 1000; printf("%s%d.%.3d\n", rlat < 0 ? "-" : "", abs(rlat) / 1000, abs(rlat) % 1000); printf("%s%d.%.3d\n", rlon < 0 ? "-" : "", abs(rlon) / 1000, abs(rlon) % 1000); Then got AC with this code lat *= 180 / pi; lon *= 180 / pi; while (lon <= -180) lon += 360; while (lon > 180) lon -= 360; printf("%.3lf\n%.3lf\n", lat, lon); So I guess there is something like "-0.000" expected by checker Edited by author 03.08.2026 11:20 |
|
|