Submission #575134

#TimeUsernameProblemLanguageResultExecution timeMemory
575134alexz1205Balloons (CEOI11_bal)C++14
10 / 100
2085 ms7644 KiB
#include <iostream> using namespace std; typedef long long int 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; 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...