제출 #724605

#제출 시각아이디문제언어결과실행 시간메모리
724605SzilBalloons (CEOI11_bal)C++14
100 / 100
261 ms5660 KiB
#include <bits/stdc++.h> using ll = long long; using ld = long double; using namespace std; struct Circle { ld x, r; }; ld inter(ld x0, ld x1, ld r) { return ((x0-x1)*(x0-x1))/(4*r); } void solve() { int n; cin >> n; vector<Circle> circles; while (n--) { ld x, lim; cin >> x >> lim; int i; for (i = circles.size() - 1; i >= 0; i--) { Circle &c = circles[i]; lim = min(lim, inter(x, c.x, c.r)); if (lim < c.r) { break; } } while (circles.size() > i + 1) circles.pop_back(); circles.push_back({x, lim}); cout << fixed << setprecision(3) << lim << "\n"; } } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t = 1; // cin >> t; while (t--) { solve(); } return 0; }

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

bal.cpp: In function 'void solve()':
bal.cpp:28:31: warning: comparison of integer expressions of different signedness: 'std::vector<Circle>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   28 |         while (circles.size() > i + 1)
      |                ~~~~~~~~~~~~~~~^~~~~~~
#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...