# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
696960 | noobnessOVERLOADED | Best Place (NOI17_bestplace) | C++14 | 0 ms | 0 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];
}
sort(a, a+n);
sort(b, b+n);
if(n % 2 = 0){
int c = n/2;
int sum1 = (a[c]+a[c+1])/2;
int sum2 = (b[c]+b[c+1])/2;
cout << sum1 << " " << sum2;
}
else{
int c = n/2;
int sum1 = a[c+1];
int sum2 = b[c+1];
cout << sum1 << " " << sum2;
}
}