Submission #941865

# Submission time Handle Problem Language Result Execution time Memory
941865 2024-03-09T15:26:15 Z Litusiano Just Long Neckties (JOI20_ho_t1) C++17
0 / 100
0 ms 348 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
	int n; cin>>n;
	vector<int> v(n+1); for(int& i : v) cin>>i;
	vector<int> b(n); for(int& i : b) cin>>i;
	sort(v.begin(),v.end()); sort(b.begin(),b.end());
	for(int i = 0; i<=n; i++){
		vector<int> v1;
		for(int j = 0; j<=n; j++){
			if(i == j) continue;
			v1.push_back(v[j]);
		}
		sort(v1.begin(),v1.end());
		int ans = 0;
		for(int j = 0; j<n; j++){
			ans = max(ans,max(0ll,v1[j] - b[j]));
		}
		cout<<ans<<" ";
	}
	cout<<endl;

}
# 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 -