Submission #524536

# Submission time Handle Problem Language Result Execution time Memory
524536 2022-02-09T12:53:52 Z mosiashvililuka Just Long Neckties (JOI20_ho_t1) C++14
0 / 100
1 ms 332 KB
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,i,j,ii,jj,zx,xc,f[200009],pr[200009],sf[200009],A[200009],B[200009];
int main(){
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>a;
	for(i=1; i<=a+1; i++){
		cin>>A[i];
	}
	for(i=1; i<=a; i++){
		cin>>B[i];
	}
	sort(A+1,A+a+2);
	sort(B+1,B+a+1);
	for(i=1; i<=a; i++){
		pr[i]=max(pr[i-1],A[i]-B[i]);
	}
	for(i=a; i>=1; i--){
		sf[i]=max(sf[i+1],A[i+1]-B[i]);
	}
	for(i=1; i<=a+1; i++){
		cout<<max(pr[i-1],sf[i])<<" ";
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -