제출 #305304

#제출 시각아이디문제언어결과실행 시간메모리
305304oleksgMobile (BOI12_mobile)C++14
0 / 100
1098 ms16924 KiB
#include <fstream> #include <string> #include <iostream> #include <math.h> #include <algorithm> #include<bits/stdc++.h> #include <vector> using namespace std; double n, l; vector<pair<double, double>> points; bool ok(double cur){ double curmaxx = 0; for (long long x = 0; x < points.size(); x++){ double curx = points[x].first; double cury = abs(points[x].second); if (cur >= cury){ double xintervals = sqrt(cur * cur - cury * cury); double minx = curx - xintervals; double maxx = curx + xintervals; if (minx <= l && maxx >= 0 && cur >= cury){ if (minx <= curmaxx){ curmaxx = max(curmaxx, maxx); if ((curmaxx) >= l){ return true; } } } } } return curmaxx >= l; } int main(){ double one, two; cin >> n >> l; for (int x = 0; x < n; x++){ cin >> one >> two; points.push_back(make_pair(one, two)); } double mi = 0.0; double ma = 10000000000; //cout << ok(658); while(ma > mi){ double cur = (mi + ma) / 2.0; if (ok(cur)){ ma = cur; } else{ mi = cur; } } printf("%.15g", ma); }

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

mobile.cpp: In function 'bool ok(double)':
mobile.cpp:15:29: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<double, double> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |     for (long long x = 0; x < points.size(); x++){
      |                           ~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...