Submission #1108236

# Submission time Handle Problem Language Result Execution time Memory
1108236 2024-11-03T13:09:19 Z overwatch9 Just Long Neckties (JOI20_ho_t1) C++17
0 / 100
1 ms 336 KB
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector <int> a(n+1), b(n);
    for (int i = 0; i < n+1; i++)
        cin >> a[i];
    for (int i = 0; i < n; i++)
        cin >> b[i];
    sort(b.begin(), b.end());
    vector <int> a2 = a;
    sort(a2.begin(), a2.end());
    for (int i = 0; i < n+1; i++) {
        int mx = 0;
        for (int j = 0, id = 0; j < n+1; j++) {
            if (i == j)
                continue;
            mx = max(mx, abs(a2[j] - b[id]));
            id++;
        }
        cout << mx << ' ';
    }
    cout << '\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -