Submission #314009

#TimeUsernameProblemLanguageResultExecution timeMemory
314009Parisa_RazzaziBalloons (CEOI11_bal)C++17
100 / 100
952 ms6512 KiB
#include <iostream> #include <iomanip> using namespace std; #include <vector> vector <pair<long long,long double>> v; long double fis,r; long long x; int main() { int n; cin >> n; for (int i = 0; i < n; i++){ cin >> x; cin >> r; long double fis; long double m = r; while (v.size() && v[v.size()-1].second <= m){ long double o = x - v[v.size()-1].first; fis = o * o / (4.0 * v[v.size()-1].second); m = min(m,fis); if (v[v.size()-1].second <= m){ v.pop_back(); } } if (v.empty()){ printf("%.6Lf\n",m); v.push_back(make_pair(x,m)); continue; } long double o = x - v[v.size()-1].first; fis = o * o / (4.0 * v[v.size()-1].second); m = min(m,fis); printf("%.6Lf\n",m); v.push_back(make_pair(x,m)); } return 0; }
#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...