-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheko.cpp
More file actions
43 lines (39 loc) · 681 Bytes
/
eko.cpp
File metadata and controls
43 lines (39 loc) · 681 Bytes
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
#include <iostream>
#include <cstring> //memset
#include <algorithm>
#include <bitset>
#include <string>
#include <vector>
#include <utility>
#include <cstdio>
#include <queue>
#include <cmath>
#include <list>
#include <set>
#include <map>
using namespace std;
vector <int> v;
int sum (int ele) {
int res = 0;
for (int i = 0; i < v.size(); ++i)
if (v[i] > ele)
res += v[i]-ele;
return res;
}
int main() {
freopen("input.txt", "r", stdin);
int len, sum, x, low, high;
cin >> len;
while (len--) {
cin >> x;
v.push_back(x);
}
sort(v.begin(), v.end());
low = v[0];
high = v[v.size()-1];
while (low <= high) {
mid = low + (high-low)/2;
if ()
}
return 0;
}