Submission #1114618

#TimeUsernameProblemLanguageResultExecution timeMemory
1114618AdamGSJust Long Neckties (JOI20_ho_t1)C++17
0 / 100
1 ms336 KiB
#include <iostream> #include <algorithm> #include <cmath> #include <queue> #include <vector> #include <stack> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); ll n; cin >> n; vector<ll> wolne(n + 1); for(int i = 0; i < n + 1; i++) { cin >> wolne[i]; } vector<ll> ter(n); for(int i = 0; i < n; i++) { cin >> ter[i]; } sort(wolne.begin(), wolne.end()); sort(ter.begin(), ter.end()); for(int i = 0; i < n + 1; i++) { ll mx = 0; for(int j = 0; j < i; j++) { mx = max(mx, wolne[j] - ter[j]); } for(int j = i; j < n; j++) { mx = max(mx, wolne[j + 1] - ter[j]); } cout << mx << "\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...