Submission #922609

# Submission time Handle Problem Language Result Execution time Memory
922609 2024-02-05T19:40:12 Z SuPythony Just Long Neckties (JOI20_ho_t1) C++17
0 / 100
1 ms 344 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main() {
    int n; cin>>n;
    vector<ll> a(n+1), b(n);
    for (int i=0; i<=n; i++) cin>>a[i];
    for (int i=0; i<n; i++) cin>>b[i];
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    for (int i=0; i<=n; i++) {
        int aind=0;
        ll ans=0;
        for (int j=0; j<n; j++) {
            if (aind==i) aind++;
            ans=max(ans,max(a[aind]-b[j],0ll));
            aind++;
        }
        cout<<ans<<" ";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -