# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
494142 |
2021-12-14T12:50:40 Z |
PikaQ |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
41028 KB |
#include<bits/stdc++.h>
#define int ll
#define forn(i,n) for(int i=0;i<(n);i++)
#define Forn(i,n) for(int i=1;i<=(n);i++)
#define ll long long
#define pb push_back
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define vi vector<int>
#define vl vector<long long>
#define vpi vector<pair<int,int> >
#define pii pair<int,int>
#define pll pair<long long,long long>
#define mp make_pair
#define rz resize
#define all(p) p.begin(),p.end()
#define alr(p,q) p+1,p+q+1
#define ull unsigned long long
#define st0(p) memset((p),0,sizeof(p))
#define T(x) ((x)%2 ? s[(x)/2] : '.')
#define lowb(x) x&-x
#define ls(x) (x)*2
#define rs(x) (x)*2+1
using namespace std;
inline void USACO(string filename){
freopen((filename+".in").c_str(),"r",stdin);
freopen((filename+".out").c_str(),"w",stdout);
}
void debug() {cout << endl;}
template <class T, class ...U> void debug(T a, U ... b) { cout << a << " "; debug(b...);}
// template <class T> int max(T a, T ... b) { cout << a << " "; debug(b...);}
const int INF = 1e9+7;
const double eps = 1e-7;
const int N = 8e2+9;
int n;
#define double long double
#define pdd pair<double,double>
int L;
vector<pdd> p;
bool check(double R){
vector<pdd> vs;
double cur = 0;
for(auto &i : p){
double dy = abs(i.S);
if(dy - R > eps) continue;
double d = sqrt(R*R - dy*dy);
double l = i.F -d,r = i.F +d;
if(l <= cur) cur = max(cur,(double)r);
}
return cur >= L;
}
void solve(){
cin >> n >> L;
p.rz(n);
forn(i,n) cin >> p[i].F >> p[i].S;
sort(all(p));
double lo = 0,hi = 1e18;
while(hi - lo > 1e-7){
double mid = (lo+hi)/2;
if(check(mid)) hi = mid;
else lo = mid;
}
// debug(check((double)10));
cout << hi << '\n';
}
signed main(){
// USACO("angry");
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
cout << fixed << setprecision(4);
// int t;
// cin >> t;
// while(t--)
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
332 KB |
Output is correct |
2 |
Correct |
3 ms |
332 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Correct |
3 ms |
400 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
460 KB |
Output is correct |
2 |
Correct |
6 ms |
460 KB |
Output is correct |
3 |
Correct |
7 ms |
460 KB |
Output is correct |
4 |
Correct |
8 ms |
452 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
456 KB |
Output is correct |
2 |
Correct |
7 ms |
460 KB |
Output is correct |
3 |
Correct |
5 ms |
460 KB |
Output is correct |
4 |
Correct |
6 ms |
448 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
460 KB |
Output is correct |
2 |
Correct |
7 ms |
460 KB |
Output is correct |
3 |
Correct |
5 ms |
460 KB |
Output is correct |
4 |
Correct |
6 ms |
460 KB |
Output is correct |
5 |
Correct |
7 ms |
460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
92 ms |
2636 KB |
Output is correct |
2 |
Correct |
101 ms |
2636 KB |
Output is correct |
3 |
Correct |
55 ms |
2244 KB |
Output is correct |
4 |
Correct |
76 ms |
2892 KB |
Output is correct |
5 |
Correct |
49 ms |
2064 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
76 ms |
2764 KB |
Output is correct |
2 |
Correct |
88 ms |
2508 KB |
Output is correct |
3 |
Correct |
77 ms |
2764 KB |
Output is correct |
4 |
Correct |
75 ms |
2764 KB |
Output is correct |
5 |
Correct |
92 ms |
3020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
92 ms |
3020 KB |
Output is correct |
2 |
Correct |
92 ms |
2892 KB |
Output is correct |
3 |
Correct |
89 ms |
3204 KB |
Output is correct |
4 |
Correct |
109 ms |
3660 KB |
Output is correct |
5 |
Correct |
81 ms |
3288 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
119 ms |
3404 KB |
Output is correct |
2 |
Correct |
120 ms |
3660 KB |
Output is correct |
3 |
Correct |
111 ms |
3628 KB |
Output is correct |
4 |
Correct |
101 ms |
3668 KB |
Output is correct |
5 |
Correct |
97 ms |
3660 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
125 ms |
3404 KB |
Output is correct |
2 |
Correct |
114 ms |
3404 KB |
Output is correct |
3 |
Correct |
101 ms |
3644 KB |
Output is correct |
4 |
Correct |
107 ms |
3600 KB |
Output is correct |
5 |
Correct |
109 ms |
3664 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
534 ms |
15948 KB |
Output is correct |
2 |
Correct |
585 ms |
23636 KB |
Output is correct |
3 |
Correct |
576 ms |
23236 KB |
Output is correct |
4 |
Correct |
498 ms |
25432 KB |
Output is correct |
5 |
Correct |
482 ms |
22748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
596 ms |
15948 KB |
Output is correct |
2 |
Correct |
626 ms |
22484 KB |
Output is correct |
3 |
Correct |
508 ms |
21596 KB |
Output is correct |
4 |
Correct |
515 ms |
25176 KB |
Output is correct |
5 |
Correct |
495 ms |
23252 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
615 ms |
19020 KB |
Output is correct |
2 |
Correct |
687 ms |
28360 KB |
Output is correct |
3 |
Correct |
679 ms |
27716 KB |
Output is correct |
4 |
Correct |
649 ms |
30860 KB |
Output is correct |
5 |
Correct |
565 ms |
26952 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
719 ms |
19020 KB |
Output is correct |
2 |
Correct |
726 ms |
26892 KB |
Output is correct |
3 |
Correct |
625 ms |
25880 KB |
Output is correct |
4 |
Correct |
668 ms |
30740 KB |
Output is correct |
5 |
Correct |
571 ms |
27792 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
726 ms |
22220 KB |
Output is correct |
2 |
Correct |
823 ms |
32972 KB |
Output is correct |
3 |
Correct |
792 ms |
32328 KB |
Output is correct |
4 |
Correct |
727 ms |
35656 KB |
Output is correct |
5 |
Correct |
680 ms |
31176 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
837 ms |
22556 KB |
Output is correct |
2 |
Correct |
878 ms |
31448 KB |
Output is correct |
3 |
Correct |
755 ms |
30536 KB |
Output is correct |
4 |
Correct |
724 ms |
35524 KB |
Output is correct |
5 |
Correct |
721 ms |
32328 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
882 ms |
26036 KB |
Output is correct |
2 |
Correct |
971 ms |
37632 KB |
Output is correct |
3 |
Correct |
910 ms |
36872 KB |
Output is correct |
4 |
Correct |
825 ms |
41028 KB |
Output is correct |
5 |
Correct |
776 ms |
36508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
953 ms |
26520 KB |
Output is correct |
2 |
Correct |
949 ms |
35892 KB |
Output is correct |
3 |
Correct |
816 ms |
34948 KB |
Output is correct |
4 |
Correct |
833 ms |
40772 KB |
Output is correct |
5 |
Correct |
773 ms |
36868 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1048 ms |
33168 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1046 ms |
33356 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |