Submission #210146

#TimeUsernameProblemLanguageResultExecution timeMemory
210146AMO5Just Long Neckties (JOI20_ho_t1)C++98
0 / 100
5 ms380 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb push_back #define all(x) (x).begin(), (x).end() #define MOD 1000000007 typedef long long ll; typedef pair <int, int> ii; typedef pair <ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vll; typedef long double ld; long long INF=LLONG_MAX; int main() { ios_base::sync_with_stdio(0); cin.tie(0); //freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); int n; cin >> n; 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,a+n+1); sort(b,b+n); for(int i = 0; i < n+1; i++){ ll cnt = 0; for(int j = 0; j < n; j++){ if(i==j)continue; if(j<i) cnt = max(a[j]-b[j],cnt); else cnt = max(a[j]-b[j-1],cnt); } cout << cnt << ' '; } cout << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...