Submission #997353

# Submission time Handle Problem Language Result Execution time Memory
997353 2024-06-12T07:34:32 Z vjudge1 Measures (CEOI22_measures) C++17
24 / 100
1500 ms 6736 KB
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
#define int ll
using vi = vector<int>;

signed main() {
    int n, m, d;
    cin >> n >> m >> d;
    vi A(n), B(m);
    for(int i = 0; i < n; ++i) {
        cin >> A[i];
        A[i] *= 2;
    }
    for(int i = 0; i < m; ++i) {
        cin >> B[i];
        B[i] *= 2;
    }
    d *= 2;
    for(int i = 0; i < m; ++i) {
        A.push_back(B[i]);
        sort(A.begin(), A.end());
        int re = 0, t = 0;
        for(int j = 1; j < A.size(); ++j) {
            int dist = A[j] - A[j - 1];
            t = max(0ll, t + (d - dist) / 2);
            re = max(re, t);
        }
        if(re % 2 == 0) cout << re / 2 << " ";
        else cout << re / 2 << ".5 ";
    }
    cout << "\n";
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:26:26: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |         for(int j = 1; j < A.size(); ++j) {
      |                        ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 141 ms 6224 KB Output is correct
10 Correct 163 ms 5972 KB Output is correct
11 Correct 71 ms 5968 KB Output is correct
12 Correct 172 ms 6704 KB Output is correct
13 Correct 64 ms 6492 KB Output is correct
14 Correct 141 ms 6484 KB Output is correct
15 Correct 107 ms 4688 KB Output is correct
16 Correct 75 ms 6736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1520 ms 2384 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1520 ms 2384 KB Time limit exceeded
2 Halted 0 ms 0 KB -