Submission #869200

# Submission time Handle Problem Language Result Execution time Memory
869200 2023-11-03T13:23:30 Z goodspeed0208 Just Long Neckties (JOI20_ho_t1) C++14
0 / 100
0 ms 348 KB
#include<iostream>
#include<vector>
#include<algorithm>
#define int long long
using namespace std;

signed main() {
	int n;
	cin >> n;
	vector<int>a(n+1), b(n);
	vector<int>ans(n);
	for (auto &i : a) cin >> i;
	for (auto &i : b) cin >> i;
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	for (int i = 0 ; i < n ; i++) {
		ans[i] = max(a[i+1] - b[i], 0ll);
	}
	for (int i = 0 ; i < n+1 ; i++) {
		cout << *max_element(ans.begin(), ans.end()) << " ";
		if (i == n) break;
		ans[i] = max(a[i] - b[i], 0ll);
	} 
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -