# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
965025 |
2024-04-18T03:20:59 Z |
pcc |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
52888 KB |
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,popcnt,sse4")
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
#define ld double
#define pld pair<ld,ld>
const int mxn = 1e6+10;
ll N,L;
pair<ll,ll> arr[mxn];
inline bool check(ld r){
vector<pld> v;
for(int i = 0;i<N;i++){
if(r<arr[i].sc)continue;
v.push_back(pld(arr[i].fs-sqrt(r*r-arr[i].sc*arr[i].sc),arr[i].fs+sqrt(r*r-arr[i].sc*arr[i].sc)));
if(v.back().fs<0&&v.back().sc>L)return true;
}
sort(v.begin(),v.end());
ld pre = 0;
for(auto &i:v){
if(pre>L)return true;
if(pre<i.fs)return false;
pre = max(pre,i.sc);
}
return pre>L;
}
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ld l = 0,r = 2e9;
cin>>N>>L;
for(int i = 0;i<N;i++)cin>>arr[i].fs>>arr[i].sc,arr[i].sc = abs(arr[i].sc);
for(int i = 0;i<45;i++){
ld mid = (l+r)/2;
if(check(mid))r = mid;
else l = mid;
}
cout<<fixed<<setprecision(10)<<l<<'\n';
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 |
1 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 |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
504 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
476 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
Output is correct |
2 |
Correct |
4 ms |
832 KB |
Output is correct |
3 |
Correct |
5 ms |
604 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
6 ms |
812 KB |
Output is correct |
3 |
Correct |
4 ms |
532 KB |
Output is correct |
4 |
Correct |
2 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
748 KB |
Output is correct |
2 |
Correct |
4 ms |
828 KB |
Output is correct |
3 |
Correct |
7 ms |
528 KB |
Output is correct |
4 |
Correct |
2 ms |
604 KB |
Output is correct |
5 |
Correct |
2 ms |
632 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
59 ms |
5968 KB |
Output is correct |
2 |
Correct |
130 ms |
7092 KB |
Output is correct |
3 |
Correct |
88 ms |
4992 KB |
Output is correct |
4 |
Correct |
18 ms |
4652 KB |
Output is correct |
5 |
Correct |
12 ms |
3784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
22 ms |
3400 KB |
Output is correct |
2 |
Correct |
17 ms |
4288 KB |
Output is correct |
3 |
Correct |
18 ms |
4580 KB |
Output is correct |
4 |
Correct |
19 ms |
4760 KB |
Output is correct |
5 |
Correct |
23 ms |
5076 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
112 ms |
6164 KB |
Output is correct |
2 |
Correct |
120 ms |
7228 KB |
Output is correct |
3 |
Correct |
100 ms |
5680 KB |
Output is correct |
4 |
Correct |
28 ms |
6092 KB |
Output is correct |
5 |
Correct |
18 ms |
4532 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
176 ms |
6872 KB |
Output is correct |
2 |
Correct |
163 ms |
7732 KB |
Output is correct |
3 |
Correct |
167 ms |
6936 KB |
Output is correct |
4 |
Correct |
34 ms |
6084 KB |
Output is correct |
5 |
Correct |
29 ms |
5444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
166 ms |
6380 KB |
Output is correct |
2 |
Correct |
164 ms |
7712 KB |
Output is correct |
3 |
Correct |
176 ms |
6972 KB |
Output is correct |
4 |
Correct |
27 ms |
6192 KB |
Output is correct |
5 |
Correct |
22 ms |
5320 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
611 ms |
25096 KB |
Output is correct |
2 |
Execution timed out |
1038 ms |
32812 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1043 ms |
25016 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
757 ms |
39652 KB |
Output is correct |
2 |
Execution timed out |
1031 ms |
46440 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1057 ms |
38592 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
977 ms |
41192 KB |
Output is correct |
2 |
Execution timed out |
1058 ms |
52888 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1025 ms |
41852 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1018 ms |
44952 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1066 ms |
45388 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1058 ms |
48484 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1049 ms |
48292 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |