Submission #869199

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

int 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], 0);
	}
	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], 0);
	} 
}
# 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 -