# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
56131 |
2018-07-10T05:23:23 Z |
노영훈(#1580) |
Mobile (BOI12_mobile) |
C++11 |
|
391 ms |
32840 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double lf;
typedef pair<ll, ll> pll;
const int MX=1000010, inf=2e9;
const ll linf=5e18;
int n;
ll l;
pll P[MX];
ll sq(ll x){ return x*x; }
lf itst(pll a, pll b){
lf dm=a.first-b.first, db=a.second-b.second;
return -db/dm;
}
int main(){
ios::sync_with_stdio(0); cin.tie(0);
cin>>n>>l;
for(int i=1; i<=n; i++){
ll x, y; cin>>x>>y;
P[i]={-2*x,x*x+y*y};
}
sort(P+1, P+n+1, [](pll &a, pll &b){
if(a.first==b.first) return a.second>b.second;
return a.first>b.first;
});
// for(int i=1; i<=n; i++) cout<<P[i].first<<' '<<P[i].second<<'\n';
vector<pll> stk; // m, b
for(int i=1; i<=n; i++){
pll now=P[i];
while(!stk.empty()){
pll prv=stk.back(); stk.pop_back();
if(now.first==prv.first) continue;
if(!stk.empty() && itst(stk.back(), prv)>=itst(prv, now)) continue;
else { stk.push_back(prv); break; }
}
stk.push_back(P[i]);
}
lf ans=0;
for(int i=1; i<(int)stk.size(); i++){
lf now=itst(stk[i], stk[i-1]);
// cout<<now<<' '<<stk[i].first*now+stk[i].second+now*now<<'\n';
now=max(now, (lf)0);
now=min(now, (lf)l);
ans=max(ans, stk[i].first*now+stk[i].second+now*now);
}
cout<<sqrtl(ans);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
252 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
356 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
432 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
464 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
592 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
800 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
20 ms |
1952 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
36 ms |
1952 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
30 ms |
4144 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
38 ms |
4144 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
38 ms |
4144 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
127 ms |
16724 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
177 ms |
16724 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
220 ms |
26612 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
221 ms |
26612 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
252 ms |
28100 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
226 ms |
28100 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
215 ms |
29732 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
352 ms |
29732 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
299 ms |
32840 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
391 ms |
32840 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |