This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// Balkan Olympiad in Informatics 2011 Day 1 Problem 3
// Medians
// https://oj.uz/problem/view/balkan11_medians
#include <bits/stdc++.h>
using namespace std;
int N;
int main() {
cin >> N;
vector<int> arr(2*N-1);
for (int i = 0; i < N; i++) {
cin >> arr[i];
}
if (N == 1) {
cout << arr[0] << "\n";
return 0;
}
for (int i = 0; i < N; i++) {
cout << arr[i] << " ";
}
if (arr[0] <= arr[1]) {
for (int i = 0; i < N-1; i++) {
cout << 2*N-1 << " ";
}
}
else {
for (int i = 0; i < N-1; i++) {
cout << 1 << " ";
}
} cout << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |