Submission #723385

# Submission time Handle Problem Language Result Execution time Memory
723385 2023-04-13T16:30:14 Z rnl42 Measures (CEOI22_measures) C++14
0 / 100
1500 ms 440 KB
#include <bits/stdc++.h>
using namespace std;

int N, M, D;
vector<int> A;
int ans = 0;

int main() {
    ios::sync_with_stdio(false), cout.tie(0), cin.tie(0);
    cin >> N >> M >> D;
    A.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    int in;
    for (int i = 0; i < M; i++) {
        cin >> in;
        auto it = lower_bound(A.begin(), A.end(), in);
        A.insert(it, in);
        int ans = 0;
        for (int i = 0; i < (int)A.size(); i++) {
            for (int j = i+1; j < (int)A.size(); j++) {
                ans = max(ans, (j-i)*D-(A[j]-A[i]));
            }
        }
        cout << (ans>>1); if (ans & 1) cout << ".5";
        cout << (i == M-1 ? '\n' : ' ');
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1558 ms 440 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1558 ms 440 KB Time limit exceeded
2 Halted 0 ms 0 KB -