# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
970767 | 2024-04-27T08:30:13 Z | hihihihaw | Mobile (BOI12_mobile) | C++17 | 1000 ms | 62904 KB |
#pragma GCC optimize("O3,unroll-loops") #include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define pii pair<int,int> #define sz(v) (int)v.size() #define fi first #define se second #define INF 1223372036854775807 #define MOD 1000000007 #define cint(x) int x;cin>>x; #define cinarr(a,n) int a[n];for (int i=0;i<n;i++) cin>>a[i]; #define coutarr(a) for (auto d:a)cout<<d<<" "; cout<<endl; #define coutarrD(a) for (auto d:a) cout<<d.fi<<","<<d.se<<" "; cout<<endl; #define AYBERK_SARICA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define endl '\n' #define ld long double #define mid (start+end)/2 int t=1; int interactive=0; int usaco=0; int testCase=0; int n,k; pair<ld,ld> v[1000023]; bool f(ld x){ pair<ld,ld> z[n]={}; for (int i=0;i<n;i++){ if (x*x-v[i].se*v[i].se>0){ ld y=sqrt(x*x-v[i].se*v[i].se); if (v[i].fi+y<0 || v[i].fi-y>k) continue; z[i]={max(v[i].fi-y,(ld)0),min(v[i].fi+y,(ld)k)}; } } //sort(z,z+n); ld b=0; for (int i=0;i<n;i++){ if (z[i].fi>b){ } else{ b=max(z[i].se,b); } } if (b!=k) return false; return true; } void solve(){ cin>>n>>k; for (int i=0;i<n;i++){ ld x,y; cin>>x>>y; v[i]={x,y}; } ld l=0,r=2000000000; int y=42; while (y--){ ld m=(l+r)/2; if (f(m)) r=m; else l=m; } cout<<setprecision(15)<<l<<endl; } int32_t main(){ AYBERK_SARICA; if (usaco){ freopen("socdist.in", "r", stdin); freopen("socdist.out", "w", stdout); } if (!interactive){ #ifdef Local freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); //freopen("wormsort.out", "w", stdout); #endif } if (t==1) solve(); else{ cin>>t; while (t--){testCase++;solve();} } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 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 | 344 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | 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 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 604 KB | Output is correct |
2 | Correct | 4 ms | 624 KB | Output is correct |
3 | Correct | 3 ms | 348 KB | Output is correct |
4 | Correct | 3 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 604 KB | Output is correct |
2 | Correct | 7 ms | 616 KB | Output is correct |
3 | Correct | 7 ms | 860 KB | Output is correct |
4 | Correct | 6 ms | 772 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 600 KB | Output is correct |
2 | Correct | 7 ms | 600 KB | Output is correct |
3 | Correct | 6 ms | 756 KB | Output is correct |
4 | Correct | 6 ms | 604 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 604 KB | Output is correct |
2 | Correct | 6 ms | 772 KB | Output is correct |
3 | Correct | 10 ms | 604 KB | Output is correct |
4 | Correct | 6 ms | 772 KB | Output is correct |
5 | Correct | 6 ms | 604 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 99 ms | 7300 KB | Output is correct |
2 | Correct | 94 ms | 7040 KB | Output is correct |
3 | Correct | 64 ms | 4188 KB | Output is correct |
4 | Correct | 81 ms | 7068 KB | Output is correct |
5 | Correct | 55 ms | 4188 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 87 ms | 7156 KB | Output is correct |
2 | Correct | 77 ms | 4732 KB | Output is correct |
3 | Correct | 89 ms | 7260 KB | Output is correct |
4 | Correct | 83 ms | 7032 KB | Output is correct |
5 | Correct | 95 ms | 7560 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 108 ms | 7468 KB | Output is correct |
2 | Correct | 103 ms | 7260 KB | Output is correct |
3 | Correct | 109 ms | 7296 KB | Output is correct |
4 | Correct | 102 ms | 7828 KB | Output is correct |
5 | Correct | 97 ms | 7504 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 122 ms | 7768 KB | Output is correct |
2 | Correct | 123 ms | 7760 KB | Output is correct |
3 | Correct | 116 ms | 7772 KB | Output is correct |
4 | Correct | 103 ms | 7844 KB | Output is correct |
5 | Correct | 106 ms | 7760 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 118 ms | 7764 KB | Output is correct |
2 | Correct | 129 ms | 8016 KB | Output is correct |
3 | Correct | 120 ms | 7760 KB | Output is correct |
4 | Correct | 102 ms | 7764 KB | Output is correct |
5 | Correct | 106 ms | 7772 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 646 ms | 32908 KB | Output is correct |
2 | Correct | 663 ms | 32896 KB | Output is correct |
3 | Correct | 652 ms | 32848 KB | Output is correct |
4 | Correct | 534 ms | 32684 KB | Output is correct |
5 | Correct | 558 ms | 39284 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 654 ms | 32848 KB | Output is correct |
2 | Correct | 633 ms | 32904 KB | Output is correct |
3 | Correct | 628 ms | 38448 KB | Output is correct |
4 | Correct | 534 ms | 41812 KB | Output is correct |
5 | Correct | 564 ms | 39996 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 769 ms | 40020 KB | Output is correct |
2 | Correct | 818 ms | 39920 KB | Output is correct |
3 | Correct | 786 ms | 48720 KB | Output is correct |
4 | Correct | 668 ms | 51576 KB | Output is correct |
5 | Correct | 675 ms | 47860 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 766 ms | 39916 KB | Output is correct |
2 | Correct | 755 ms | 40020 KB | Output is correct |
3 | Correct | 735 ms | 46960 KB | Output is correct |
4 | Correct | 648 ms | 51880 KB | Output is correct |
5 | Correct | 677 ms | 48720 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 907 ms | 45104 KB | Output is correct |
2 | Correct | 918 ms | 45108 KB | Output is correct |
3 | Correct | 908 ms | 55380 KB | Output is correct |
4 | Correct | 769 ms | 58652 KB | Output is correct |
5 | Correct | 794 ms | 54356 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 922 ms | 45100 KB | Output is correct |
2 | Correct | 866 ms | 44956 KB | Output is correct |
3 | Correct | 867 ms | 53564 KB | Output is correct |
4 | Correct | 774 ms | 58588 KB | Output is correct |
5 | Correct | 778 ms | 55376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1040 ms | 52308 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1044 ms | 52564 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1066 ms | 62860 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1020 ms | 62904 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |