# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
671057 | a_aguilo | Balloons (CEOI11_bal) | C++14 | 503 ms | 8244 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
int n;
long double Radius(int d, long double r){
return (long double)(d)*((long double) d/(4*r));
}
void print(vector<pair<int, long double>>& V){
cout << V[0].first << " " << V[0].second;
for(int i = 1; i < V.size(); ++i) cout << " | "<< V[i].first << " " << V[i].second;
cout << endl;
}
int main(){
cin >> n;
int lastIdx;
int position[n];
long double radius[n];
vector<pair<int, long double>> MyStack;
cin >> position[0] >> radius[0];
MyStack.push_back({position[0], radius[0]});
for(int i = 1; i < n; ++i){
cin >> position[i] >> radius[i];
while((MyStack.size() > 0)){
lastIdx = MyStack.size()-1;
long double LastRad = Radius(position[i] - MyStack[lastIdx].first, MyStack[lastIdx].second);
if (radius[i] < LastRad) break;
else {
radius[i] = LastRad;
MyStack.pop_back();
}
}
MyStack.push_back({position[i], radius[i]});
//cout << i << endl;
//print(MyStack);
}
//cout << endl;
for(int i = 0; i < n; ++i) cout << fixed << radius[i] << endl;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |