Submission #1032454

#TimeUsernameProblemLanguageResultExecution timeMemory
1032454FatemehSalimiBalloons (CEOI11_bal)C++17
10 / 100
121 ms6736 KiB
//in the neme of god #include <bits/stdc++.h> using namespace std; stack <int> st; const int MAX_N = 2e5 + 10; double n, x[MAX_N], r[MAX_N], ans[MAX_N]; int main(){ ios_base::sync_with_stdio(0), cin.tie(0); cin >> n; for (int i = 0; i < n; i++) { cin >> x[i] >> r[i]; ans[i] = r[i]; while (st.size() && ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * ans[st.top()])) <= r[i]) { ans[i] = ((x[i] - x[st.top()]) * (x[i] - x[st.top()]) / (4 * ans[st.top()])); st.pop(); } st.push(i); } for (int i = 0; i < n; i++) cout << fixed << setprecision(3) << ans[i] << '\n'; }
#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...