Submission #575137

#TimeUsernameProblemLanguageResultExecution timeMemory
575137alexz1205Balloons (CEOI11_bal)C++14
50 / 100
2096 ms9684 KiB
#include <iostream> #include <iomanip> using namespace std; //typedef long long int lint; typedef long double lint; lint dist(lint p1, lint p2, lint r1){ return (p1-p2)*(p1-p2)/4/r1; } int main() { int n; cin >> n; lint pos[n], maxr[n], rad[n]; for (int x = 0; x < n; x ++){ cin >> pos[x] >> maxr[x]; // pos[x] *= 10000; // maxr[x] *= 10000; } for (int x = 0; x < n; x ++){ rad[x] = maxr[x]; for (int y = 0; y < x; y ++){ rad[x] = min(dist(pos[y], pos[x], rad[y]), rad[x]); } } for (int x = 0; x < n; x ++){ // cout << rad[x] << endl; cout << fixed << setprecision(3) << rad[x] << endl; // if ((rad[x]/10) % 1000 < 10){ // cout << rad[x]/10000 << ".00" << (rad[x]/10) % 1000 << endl; // }else if ((rad[x]/10) % 1000 < 100){ // cout << rad[x]/10000 << ".0" << (rad[x]/10) % 1000 << endl; // }else { // cout << rad[x]/10000 << "." << (rad[x]/10) % 1000 << endl; // } } 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...