제출 #1130591

#제출 시각아이디문제언어결과실행 시간메모리
1130591lopkusJust Long Neckties (JOI20_ho_t1)C++20
9 / 100
1094 ms4720 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<int> a(n + 2); vector<int> b(n + 1); for(int i = 1; i <= n + 1; i++) { cin >> a[i]; } for(int i = 1; i <= n; i++) { cin >> b[i]; } sort(b.begin() + 1, b.end()); for(int i = 1; i <= n + 1; i++) { vector<int> v(n + 1); int p = 1; for(int j = 1; j <= n + 1; j++) { if(j ^ i) { v[p++] = a[j]; } } sort(v.begin() + 1, v.end()); int ans = 0; for(int j = 1; j <= n; j++) { ans = max(ans, v[j] - b[j]); } cout << ans << " "; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...