# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
67571 | 2018-08-15T03:13:25 Z | thebes | Mobile (BOI12_mobile) | C++14 | 799 ms | 70960 KB |
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,ssse3,sse3,sse4,popcnt,avx,mmx,abm,tune=native") #include <bits/stdc++.h> #define sq(x) ((x)*(x)) using namespace std; const int MN = 1e6+6, MM = 1e9+7; double lo, hi = MM, eps = 1e-6; int N, M, i, j; pair<int,int> pnt[MN]; inline bool check(double d){ double mx = 0; for(int i=1;i<=N;i++){ if(abs(pnt[i].second)>d) continue; double dx=sqrt(sq(d)-sq(pnt[i].second)); if(pnt[i].first-dx<=mx) mx=max(mx,pnt[i].first+dx); else return 0; } return mx>=M; } int main(){ for(scanf("%d%d",&N,&M),i=1;i<=N;i++) scanf("%d%d",&pnt[i].first,&pnt[i].second); sort(pnt+1,pnt+N+1,[](pair<int,int>i,pair<int,int>j){return i.first<j.first;}); while(lo+eps<hi){ double m = (lo+hi)/2.0; if(check(m)) hi=m; else lo=m+eps; } printf("%.6lf\n",lo); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 3 ms | 496 KB | Output is correct |
3 | Incorrect | 2 ms | 496 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 496 KB | Output is correct |
2 | Correct | 3 ms | 568 KB | Output is correct |
3 | Correct | 2 ms | 572 KB | Output is correct |
4 | Incorrect | 2 ms | 576 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 580 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 728 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 728 KB | Output is correct |
2 | Correct | 6 ms | 768 KB | Output is correct |
3 | Incorrect | 6 ms | 964 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 964 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 59 ms | 2256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 46 ms | 3048 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 72 ms | 3820 KB | Output is correct |
2 | Incorrect | 56 ms | 4980 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 64 ms | 6536 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 91 ms | 6584 KB | Output is correct |
2 | Incorrect | 72 ms | 8164 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 395 ms | 11288 KB | Output is correct |
2 | Incorrect | 308 ms | 18924 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 270 ms | 18924 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 499 ms | 19712 KB | Output is correct |
2 | Incorrect | 362 ms | 29056 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 318 ms | 29056 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 616 ms | 29832 KB | Output is correct |
2 | Incorrect | 468 ms | 40704 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 499 ms | 40768 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 638 ms | 41420 KB | Output is correct |
2 | Incorrect | 601 ms | 53856 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 454 ms | 53864 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 785 ms | 55528 KB | Output is correct |
2 | Incorrect | 799 ms | 70888 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 514 ms | 70960 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |