답안 #997351

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
997351 2024-06-12T07:33:12 Z vjudge1 Measures (CEOI22_measures) C++17
0 / 100
1500 ms 3432 KB
#include <bits/stdc++.h>

using namespace std;

using vi = vector<int>;

int 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(0, 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:24:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |         for(int j = 1; j < A.size(); ++j) {
      |                        ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 448 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 348 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 Incorrect 1 ms 348 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 448 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 348 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 Incorrect 1 ms 348 KB Output isn't correct
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1571 ms 3432 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1571 ms 3432 KB Time limit exceeded
2 Halted 0 ms 0 KB -