Submission #19071543


Source Code Expand

Copy
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = (1LL << 61);

signed main() {
	int n; cin >> n;
	vector<int>a(n); for (int i = 0; i < n; i++)cin >> a[i];
	vector<int>b;
	sort(a.begin(), a.end());
	for (int i = 0; i < n / 2; i++) {
		b.push_back(a[n - i - 1] + a[i]);
	}
	sort(b.begin(), b.end());
	cout << b[b.size() - 1] - b[0] << endl;
}

Submission Info

Submission Time
Task A - Table Tennis
User Example
Language C++ (GCC 9.2.1)
Score 100
Code Size 416 Byte
Status AC
Exec Time 12 ms
Memory 3568 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 27
Set Name Test Cases
All 00-sample-00.txt, 00-sample-01.txt, 10-unique-00.txt, 10-unique-01.txt, 10-unique-02.txt, 10-unique-03.txt, 10-unique-04.txt, 20-order-00.txt, 20-order-01.txt, 20-order-02.txt, 20-order-03.txt, 20-order-04.txt, 30-random-00.txt, 30-random-01.txt, 30-random-02.txt, 30-random-03.txt, 30-random-04.txt, 30-random-05.txt, 30-random-06.txt, 30-random-07.txt, 30-random-08.txt, 30-random-09.txt, 30-random-10.txt, 30-random-11.txt, 30-random-12.txt, 30-random-13.txt, 30-random-14.txt
Case Name Status Exec Time Memory
00-sample-00.txt AC 12 ms 3536 KB
00-sample-01.txt AC 6 ms 3468 KB
10-unique-00.txt AC 3 ms 3412 KB
10-unique-01.txt AC 2 ms 3512 KB
10-unique-02.txt AC 2 ms 3416 KB
10-unique-03.txt AC 2 ms 3516 KB
10-unique-04.txt AC 2 ms 3352 KB
20-order-00.txt AC 2 ms 3420 KB
20-order-01.txt AC 2 ms 3420 KB
20-order-02.txt AC 2 ms 3512 KB
20-order-03.txt AC 2 ms 3520 KB
20-order-04.txt AC 1 ms 3520 KB
30-random-00.txt AC 2 ms 3508 KB
30-random-01.txt AC 2 ms 3420 KB
30-random-02.txt AC 3 ms 3352 KB
30-random-03.txt AC 2 ms 3420 KB
30-random-04.txt AC 2 ms 3568 KB
30-random-05.txt AC 5 ms 3512 KB
30-random-06.txt AC 2 ms 3476 KB
30-random-07.txt AC 2 ms 3412 KB
30-random-08.txt AC 2 ms 3472 KB
30-random-09.txt AC 2 ms 3504 KB
30-random-10.txt AC 2 ms 3568 KB
30-random-11.txt AC 2 ms 3420 KB
30-random-12.txt AC 2 ms 3520 KB
30-random-13.txt AC 2 ms 3356 KB
30-random-14.txt AC 2 ms 3412 KB