# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1023066 |
2024-07-14T09:10:46 Z |
tanprodium |
Mobile (BOI12_mobile) |
C++14 |
|
1000 ms |
97480 KB |
// include
#include<bits/stdc++.h>
using namespace std;
// define
#define fi first
#define se second
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define eb emplace_back
#define upb upper_bound
#define lwb lower_bound
#define left VAN
#define right TAN
#define sz(a) (int)a.size()
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).begin(),(a).end()
#define sort_and_unique(a) sort(all(a));(a).resize(unique(all(a))-a.begin())
#define max_ max_element
#define min_ min_element
// another define
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
using mii = map<int, int>;
using mil = map<int, ll>;
using mli = map<ll, int>;
using mll = map<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
// random
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// templates
template<class X, class Y>
bool maximize(X &x, const Y &y) {
if (y > x) {
x = y;
return (true);
} else return (false);
}
template<class X, class Y>
bool minimize(X &x, const Y &y) {
if (y < x) {
x = y;
return (true);
} else return (false);
}
template<class T>
void print(const T &a, const int &l, const int &r) {
for (int i = l; i <= r; i++)
cout << a[i] << ' ';
cout << '\n';
}
// limit
const int oo = 2e9;
const int N = 1e6;
// function
void yesno(bool x) {
cout << (x ? "YES\n" : "NO\n");
}
// mem
ll L;
int n;
ld x[N + 5], y[N + 5];
bool ok(ld d) {
vector<pair<ld, ld>> s;
for (int i = 1; i <= n; i++) {
ld y0 = abs(y[i]);
if (y0 <= d) {
ld delta = sqrt(d * d - y0 * y0);
s.pub({x[i] - delta, x[i] + delta});
}
}
sort(all(s));
if (sz(s) == 0) return (false);
if (s[0].fi > 0.0) return (false);
ld r = 0.0;
for (int i = 0; i < sz(s); i++) {
if (r >= s[i].fi) maximize(r, s[i].se);
}
if (r >= L) return (true);
else return (false);
}
ld BS() {
ld l = 0.0, r = 2e9;
for (int _ = 1; _ <= 45; _++) {
ld mid = (l + r) / 2;
if (ok(mid))
r = mid;
else l = mid;
}
return (r);
}
void solve() {
cin >> n >> L;
for (int i = 1; i <= n; i++) {
cin >> x[i] >> y[i];
}
cout << fixed << setprecision(4) << BS() << '\n';
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int t = 1;
//cin >> t;
while (t--) solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
508 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
776 KB |
Output is correct |
2 |
Correct |
9 ms |
816 KB |
Output is correct |
3 |
Correct |
5 ms |
604 KB |
Output is correct |
4 |
Correct |
8 ms |
808 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
1096 KB |
Output is correct |
2 |
Correct |
19 ms |
1276 KB |
Output is correct |
3 |
Correct |
23 ms |
1108 KB |
Output is correct |
4 |
Correct |
10 ms |
1120 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
1120 KB |
Output is correct |
2 |
Correct |
18 ms |
1144 KB |
Output is correct |
3 |
Correct |
23 ms |
1096 KB |
Output is correct |
4 |
Correct |
10 ms |
1116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
1128 KB |
Output is correct |
2 |
Correct |
18 ms |
1268 KB |
Output is correct |
3 |
Correct |
26 ms |
1112 KB |
Output is correct |
4 |
Correct |
11 ms |
1144 KB |
Output is correct |
5 |
Correct |
13 ms |
1096 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
225 ms |
10128 KB |
Output is correct |
2 |
Correct |
475 ms |
10500 KB |
Output is correct |
3 |
Correct |
304 ms |
6524 KB |
Output is correct |
4 |
Correct |
169 ms |
10492 KB |
Output is correct |
5 |
Correct |
164 ms |
6072 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
245 ms |
10292 KB |
Output is correct |
2 |
Correct |
197 ms |
9848 KB |
Output is correct |
3 |
Correct |
221 ms |
10708 KB |
Output is correct |
4 |
Correct |
194 ms |
10756 KB |
Output is correct |
5 |
Correct |
157 ms |
11480 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
412 ms |
10792 KB |
Output is correct |
2 |
Correct |
549 ms |
10920 KB |
Output is correct |
3 |
Correct |
685 ms |
10876 KB |
Output is correct |
4 |
Correct |
119 ms |
12704 KB |
Output is correct |
5 |
Correct |
262 ms |
11080 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
516 ms |
12520 KB |
Output is correct |
2 |
Correct |
673 ms |
12292 KB |
Output is correct |
3 |
Correct |
831 ms |
11912 KB |
Output is correct |
4 |
Correct |
140 ms |
12760 KB |
Output is correct |
5 |
Correct |
281 ms |
12104 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
434 ms |
12368 KB |
Output is correct |
2 |
Correct |
655 ms |
12268 KB |
Output is correct |
3 |
Correct |
849 ms |
11904 KB |
Output is correct |
4 |
Correct |
129 ms |
12688 KB |
Output is correct |
5 |
Correct |
255 ms |
12152 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1020 ms |
52524 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1034 ms |
56444 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1045 ms |
73660 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1067 ms |
78368 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1040 ms |
77700 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1074 ms |
83168 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1065 ms |
81684 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1067 ms |
87936 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1071 ms |
89808 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1025 ms |
97480 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |