# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
696961 | noobnessOVERLOADED | Best Place (NOI17_bestplace) | C++14 | 87 ms | 2960 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
int b[n];
for(int i = 0; i <= n-1; i++){
cin >> a[i];
}
for(int j = 0; j <= n-1; j++){
cin >> b[j];
}
int c = n/2;
int k = 2*c;
int d = n-k;
sort(a, a+n);
sort(b, b+n);
if(d = 1){
int c = n/2;
int sum1 = a[c+1];
int sum2 = b[c+1];
cout << sum1 << " " << sum2;
}
else{
int c = n/2;
int sum1 = (a[c]+a[c+1])/2;
int sum2 = (b[c]+b[c+1])/2;
cout << sum1 << " " << sum2;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |