Submission #1098706

#TimeUsernameProblemLanguageResultExecution timeMemory
1098706sanoBalloons (CEOI11_bal)C++14
100 / 100
207 ms11676 KiB
#include<iostream> #include<vector> #include<queue> #include<deque> #include<string> #include<fstream> #include<algorithm> #include <iomanip> #include<map> #include <set> #include <unordered_map> #include <stack> #include <unordered_set> #include <cmath> #define ll long long #define For(i, n) for(int i = 0; i < (int)n; i++) #define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++) #define rfor(i, n) for(int i = (int)n; i >= (int)0; i--) #define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--) #define vec vector #define ff first #define ss second #define pb push_back #define shit short int #define pii pair<int, int> #define NEK 2147483640 #define mod 1000000007 #define mod2 1000000009 #define rsz resize #define prv1 43 #define prv2 47 #define D 8 using namespace std; int main() { int n; cin >> n; vec<long double> x(n), r(n); For(i, n) cin >> x[i] >> r[i]; stack<int> s; For(i, n) { while (!s.empty()) { long double r2 = (x[i] - x[s.top()]) * (x[i] - x[s.top()]) / 4 / r[s.top()]; r[i] = min(r2, r[i]); if (r[i] >= r[s.top()]) s.pop(); else break; } s.push(i); } cout << fixed << setprecision(3); For(i, n) cout << r[i] << '\n'; 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...