답안 #210148

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
210148 2020-03-16T16:22:22 Z AMO5 Just Long Neckties (JOI20_ho_t1) C++
0 / 100
5 ms 376 KB
#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end() 
#define MOD 1000000007

typedef long long ll;
typedef pair <int, int> ii;
typedef pair <ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef long double ld;

long long INF=LLONG_MAX;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    //freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
	int n; cin >> n;
	ll a[n+1],b[n];
	for(int i = 0; i <= n; i++)cin >> a[i];
	for(int i = 0; i < n; i++)cin >> b[i];
	sort(a,a+n+1);
	sort(b,b+n);
	for(int i = 0; i < n+1; i++){
		ll cnt = 0;
		for(int j = 0; j < n; j++){
			if(i==j)continue;
			if(j<i)
				cnt = max(a[j]-b[j],cnt);
			else 
				cnt = max(a[j]-b[j-1],cnt);
		}
		cout << cnt;
		if(i<=n)cout << ' ';
		else cout << endl;
	}
}	
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -