Created
March 4, 2017 15:13
-
-
Save Acarus/c161ca5c69a5e1e0c14145baf58c325d to your computer and use it in GitHub Desktop.
A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
using ll = long long; | |
int main(int argc, char **argv) { | |
// ios::sync_with_stdio(false); | |
srand(time(0)); | |
#ifndef ONLINE_JUDGE | |
freopen("/home/acarus/input.txt", "r", stdin); | |
#endif | |
int n, x; | |
scanf("%d", &n); | |
int xMin = INT_MAX, xMax = INT_MIN; | |
for (int i = 0; i < n; ++i) { | |
scanf("%d", &x); | |
xMin = min(xMin, x); | |
xMax = max(xMax, x); | |
} | |
printf("%d\n", xMin + (xMax - xMin) / 2); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment