답안 #862121

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
862121 2023-10-17T14:24:50 Z vgtcross Measures (CEOI22_measures) C++17
35 / 100
40 ms 5464 KB
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

void print_ans(ll ans) {
    cout << ans/2;
    if (ans & 1) cout << ".5";
    cout << ' ';
}

void solve() {
    ll n, m, d;
    cin >> n >> m >> d;
     
    if (false) {
        d *= 2;
        vector<ll> v(n);
        for (ll &i : v) {
            cin >> i;
            i *= 2;
        }

        for (int i = 0; i < m; ++i) {
            ll u;
            cin >> u;
            v.push_back(2*u);
            sort(v.begin(), v.end());
            ll l = -1, r = 1e15;
            while (r-l > 1) {
                ll md = (l + r) / 2;
                ll pp = -1e18;
                bool g = 1;
                for (int j : v) {
                    ll pos = max(j - md, pp + d);
                    g &= pos <= j + md;
                    pp = pos;
                }
                if (g) r = md;
                else l = md;
            }
            print_ans(r);
        }
    } else {
        ll ans = 0;
        ll minv = 1e18;
        for (int i = 0; i < m; ++i) {
            ll v;
            cin >> v;
            v = d * i - v;
            minv = min(minv, v);
            ans = max(ans, v - minv);
            print_ans(ans);
        }
    }
    cout << '\n';
}

int main() {
    cin.tie(0) -> sync_with_stdio(0);
    
    solve();
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 3272 KB Output is correct
2 Correct 36 ms 5464 KB Output is correct
3 Correct 35 ms 5240 KB Output is correct
4 Correct 29 ms 3156 KB Output is correct
5 Correct 36 ms 4436 KB Output is correct
6 Correct 40 ms 3340 KB Output is correct
7 Correct 35 ms 4468 KB Output is correct
8 Correct 31 ms 3156 KB Output is correct
9 Correct 31 ms 2900 KB Output is correct
10 Correct 36 ms 5444 KB Output is correct
11 Correct 34 ms 3804 KB Output is correct
12 Correct 34 ms 4692 KB Output is correct
13 Correct 31 ms 3156 KB Output is correct
14 Correct 34 ms 4888 KB Output is correct
15 Correct 35 ms 4692 KB Output is correct
16 Correct 38 ms 2640 KB Output is correct
17 Correct 33 ms 4384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 3272 KB Output is correct
2 Correct 36 ms 5464 KB Output is correct
3 Correct 35 ms 5240 KB Output is correct
4 Correct 29 ms 3156 KB Output is correct
5 Correct 36 ms 4436 KB Output is correct
6 Correct 40 ms 3340 KB Output is correct
7 Correct 35 ms 4468 KB Output is correct
8 Correct 31 ms 3156 KB Output is correct
9 Correct 31 ms 2900 KB Output is correct
10 Correct 36 ms 5444 KB Output is correct
11 Correct 34 ms 3804 KB Output is correct
12 Correct 34 ms 4692 KB Output is correct
13 Correct 31 ms 3156 KB Output is correct
14 Correct 34 ms 4888 KB Output is correct
15 Correct 35 ms 4692 KB Output is correct
16 Correct 38 ms 2640 KB Output is correct
17 Correct 33 ms 4384 KB Output is correct
18 Incorrect 39 ms 4676 KB Output isn't correct
19 Halted 0 ms 0 KB -