제출 #605457

#제출 시각아이디문제언어결과실행 시간메모리
605457bzhu524Mobile (BOI12_mobile)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; pair<ll, ll> p[1000000]; int main() { ios_base::sync_with_stdio(false); int n, len; cin >> n >> len; for (int i=0; i<n; i++) cin >> p[i].first >> p[i].second; double lower = 1; double upper = 1000000000; while (upper - lower >= 1e-3) { double mid = (upper + lower) / 2; double currPoint = 0; for (int i=0; i<n; i++) { ll x = p[i].first; ll y = p[i].second; double delta = sqrt(mid * mid - y * y); double p1 = x - delta; double p2 = x + delta; if (p1 <= currPoint) { currPoint = Math.max(currPoint, p2); } } if (currPoint < len) { lower = mid; } else { upper = mid; } } cout << setprecision(4) << lower << "\n"; }

컴파일 시 표준 에러 (stderr) 메시지

mobile.cpp: In function 'int main()':
mobile.cpp:32:17: error: 'Math' was not declared in this scope
   32 |     currPoint = Math.max(currPoint, p2);
      |                 ^~~~