Submission #696229

#TimeUsernameProblemLanguageResultExecution timeMemory
696229iguBest Place (NOI17_bestplace)C++17
100 / 100
92 ms3084 KiB
#include<iostream> #include <bits/stdc++.h> using namespace std; double median(int arr[], int size){ sort(arr, arr+size); if (size % 2 != 0) return (double)arr[size/2]; return (double)(arr[(size-1)/2] + arr[size/2])/2.0; } int main() { int x; cin >> x; int ans; int bns; int a; int b; int arr[x]; int brr[x]; for (int i = 0; i < x; i++){ cin >> a >> b; arr[i]=a; brr[i]=b; } ans = median(arr,x); bns = median(brr,x); cout << ans << " " << bns; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...