# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
90520 |
2018-12-22T05:49:11 Z |
AbduM |
Sure Bet (CEOI17_sure) |
C++14 |
|
2 ms |
376 KB |
/// In the name of GOD
/// I love my MOTHER
/// Only GOLD
#include <bits/stdc++.h>
#define sz(s) (ll)(s.size())
#define all(x) (x.begin(), x.end())
#define pb push_back
#define pf push_front
#define F first
#define S second
#define ort1 exit(0);
#define nl endl
#define db double
#define TL clock() / (double)CLOCKS_PER_SEC
#define NFS ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const double pi = acos(-1.0);
const double eps = 1e-9;
const int mod = 1e9 + 7;
const ll INF = 1e12 + 1;
const int N = 1e5 + 9;
int n;
double l[N], r[N];
double mx;
double ans[N], san[N];
int main()
{
cin >> n;
for(int i = 1; i <= n; ++i){
cin >> l[i] >> r[i];
}
sort(l + 1, l + 1 + n);
sort(r + 1, r + 1 + n);
reverse(l + 1, l + 1 + n);
reverse(r + 1, r + 1 + n);
for(int i = 1; i <= n; ++i){
ans[i] = ans[i - 1] + l[i];
san[i] = san[i - 1] + r[i];
}
for(int i = 0; i <= n; ++i){
for(int j = 0; j <= n; ++j){
double mn = mod;
mn = min(mn, double(san[j] - (double)(i + j)) );
mn = min(mn, double(ans[i] - (double)(i + j)) );
mx = max(mx, mn);
}
}
cout << fixed << mx << setprecision(4);
ort1
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |