# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
547047 | mgl_diamond | Balloons (CEOI11_bal) | C++14 | 619 ms | 1644 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define ii pair<int, int>
#define dd pair<ld, ld>
#define iii pair<int, ii>
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << "> " << #x << ": " << x << '\n'
template<class T> bool maximize(T&a, T b) { if (a<b) return a=b, 1; return 0; }
template<class T> bool minimize(T&a, T b) { if (a>b) return a=b, 1; return 0; }
void setIO(string name="") {
ios::sync_with_stdio(0); cin.tie(0);
if (name.size()) freopen((name+".in").c_str(), "r", stdin);
if (name.size()) freopen((name+".out").c_str(), "w", stdout);
}
int n;
stack<dd> st;
int main() {
cin >> n;
for(int i=0; i<n; ++i) {
ld x, r; cin >> x >> r;
while (st.size()) {
ld x1=st.top().fi, r1=st.top().se;
ld val=x1-x;
minimize(r, (val*val)/(4*r1));
if (r>=r1) st.pop();
else break;
}
st.push({x, r});
cout << r << " ";
}
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... |