# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
847633 | 2023-09-10T05:40:21 Z | hariaakas646 | Mobile (BOI12_mobile) | C++17 | 324 ms | 16076 KB |
#include <bits/stdc++.h> using namespace std; #define scd(t) scanf("%d", &t) #define scld(t) scanf("%ld", &t) #define sclld(t) scanf("%lld", &t) #define scc(t) scanf("%c", &t) #define scs(t) scanf("%s", t) #define scf(t) scanf("%f", &t) #define sclf(t) scanf("%lf", &t) #define forr(i, j, k) for (int i = j; i < k; i++) #define frange(i, j) forr(i, 0, j) #define all(cont) cont.begin(), cont.end() #define mp make_pair #define pb push_back #define f first #define s second typedef long int li; typedef unsigned long int uli; typedef long long int lli; typedef unsigned long long int ulli; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<bool> vb; typedef vector<lli> vll; typedef vector<string> vs; typedef vector<pii> vii; typedef vector<vi> vvi; typedef map<int, int> mpii; typedef set<int> seti; typedef multiset<int> mseti; typedef long double ld; void usaco() { freopen("input.in", "r", stdin); // freopen("problem.out", "w", stdout); } int n; lli l; vector<pair<lli, lli>> vec; ld dist(ld x1, ld y1, ld x2, ld y2) { return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); } bool check(ld x) { ld prev = 0; forr(i, 1, n+1) { auto p = vec[i]; if(prev <= p.f && dist(p.f, p.s, prev, 0) > x) { continue; } ld v = sqrt(x*x - p.s * p.s) + p.f; prev = max(prev, v); } return prev >= l; } int main() { // usaco(); scd(n); sclld(l); vec = vector<pair<lli, lli>>(n+1); forr(i, 1, n+1) { sclld(vec[i].f); sclld(vec[i].s); } ld lo = 0; ld hi = 4e9; while(hi - lo >= 1e-4) { ld mid = (lo + hi)/2; if(check(mid)) { hi = mid; } else lo = mid; } ld out = sqrt(ld(lo)); cout << lo << "\n"; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 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 | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 516 KB | Output is correct |
2 | Correct | 2 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Incorrect | 1 ms | 348 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 344 KB | Output is correct |
2 | Incorrect | 2 ms | 344 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 348 KB | Output is correct |
2 | Incorrect | 2 ms | 348 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Incorrect | 2 ms | 516 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 43 ms | 1372 KB | Output is correct |
2 | Incorrect | 32 ms | 2648 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 53 ms | 1648 KB | Output is correct |
2 | Correct | 55 ms | 2348 KB | Output is correct |
3 | Incorrect | 56 ms | 2720 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 28 ms | 1820 KB | Output is correct |
2 | Incorrect | 30 ms | 2872 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 35 ms | 1884 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 47 ms | 1984 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 173 ms | 8256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 161 ms | 8028 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 207 ms | 9820 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 201 ms | 9816 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 228 ms | 11388 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 231 ms | 11388 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 293 ms | 12948 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 251 ms | 12952 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 324 ms | 16076 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 315 ms | 16076 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |