Submission #243124

# Submission time Handle Problem Language Result Execution time Memory
243124 2020-06-30T11:39:34 Z socho Just Long Neckties (JOI20_ho_t1) C++14
0 / 100
5 ms 384 KB
#include "bits/stdc++.h"
using namespace std;
void fast() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
}
void ran() {
	srand(chrono::steady_clock::now().time_since_epoch().count());
}
long long get_rand() {
	long long a = rand();
	long long b = rand();
	return a * (RAND_MAX + 1ll) + b; 
}
// #define endl '\n'
// #define double long double
// #define int long long
// int MOD = 1000 * 1000 * 1000 + 7;
// int MOD = 998244353;

signed main() {
	
	ran(); fast();
	
	int n;
	cin >> n;
	
	int 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(b, b+n);
	
	for (int i=0; i<=n; i++) {
		vector<int> t;
		for (int j=0; j<=n; j++) {
			if (j != i) {
				t.push_back(a[j]);
			}
		}
		sort(t.begin(), t.end());
		int f = 0;
		for (int j=0; j<n; j++) {
			f = max(f, abs(t[j] - b[j]));
		}
		cout << f << ' ';
	}
	cout << endl;
	
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 4 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 4 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 4 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -