Submission #918742

# Submission time Handle Problem Language Result Execution time Memory
918742 2024-01-30T10:44:16 Z Aiperiii Just Long Neckties (JOI20_ho_t1) C++14
0 / 100
0 ms 344 KB
#include <bits/stdc++.h>
#define int long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
using namespace std;
signed main(){
   ios_base::sync_with_stdio();
   cin.tie(0);cout.tie(0);
   int n;
   cin>>n;
   vector <int> 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(all(b));sort(all(a));
   int mx=0;
   for(int i=0;i<n;i++){
      mx=max(mx,max(0ll,a[i]-b[i]));
   }
   vector <int> ans;
   ans.pb(mx);
   for(int i=n;i>=1;i--){
      mx=max(mx,max(0ll,a[i]-b[i-1]));
      ans.pb(mx);
   }
   reverse(all(ans));
   for(auto x : ans)cout<<x<<" ";
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -