답안 #485191

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
485191 2021-11-06T14:03:06 Z Neos Balloons (CEOI11_bal) C++14
0 / 100
4 ms 332 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vii> vvii;

#define task "bongbong"
#define fastIO ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define forw(i, l, r) for( ll i = (l) ; i < (r) ; i++ )
#define forb(i, r, l) for( ll i = (r) ; i >= (l) ; i-- )
#define numBit(x) (__builtin_popcountll(1ll * (x)))
#define getBit(x, i) ((x) >> (i) & 1)
#define sz(x) (int)x.size()
#define mp make_pair
#define fi first
#define se second
#define ar array
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define debug(x) cerr << #x << " = " << x << '\n';

const int N = 2e5 + 7;

int n;
ld p[N], r[N];

int main() {
#ifndef ONLINE_JUDGE
    freopen(task".inp", "r", stdin);
    freopen(task".out", "w", stdout);
#endif
    fastIO;
    cin >> n;

    stack<int> st;
    forw(i, 0, n) {
        cin >> p[i] >> r[i];
        while (sz(st)) {
            int j = st.top();
            r[i] = min(r[i], (p[j] - p[i]) * (p[j] - p[i]) / (4 * r[j]));
            if (r[i] >= r[j]) st.pop(); else break;
        }
        st.push(i);
        cout << fixed << setprecision(3) << r[i] << '\n';
    }
}

Compilation message

bal.cpp: In function 'int main()':
bal.cpp:41:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   41 |     freopen(task".inp", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
bal.cpp:42:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   42 |     freopen(task".out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 332 KB Unexpected end of file - double expected
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 332 KB Unexpected end of file - double expected
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 332 KB Unexpected end of file - double expected
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 332 KB Unexpected end of file - double expected
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 332 KB Unexpected end of file - double expected
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 332 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 332 KB Unexpected end of file - double expected
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 332 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 332 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 332 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -