-
Notifications
You must be signed in to change notification settings - Fork 14
/
10107.cpp
54 lines (46 loc) · 1.13 KB
/
10107.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
typedef unsigned int uint;
typedef long long int64;
typedef unsigned long long uint64;
using namespace std;
int main(){
vector <int64> vec;
vector <int64>::iterator it;
int64 num, val;
while(cin>>num){
vec.push_back(num);
sort(vec.begin(), vec.end());
int len = (int) vec.size();
int cen = (int) len/2;
if(len%2 == 0)
val = ( vec[cen] + vec[cen-1] ) / 2;
else
val = vec[cen];
cout<<val<<endl;
}
return 0;
}