Submission #321586

# Submission time Handle Problem Language Result Execution time Memory
321586 2020-11-12T19:52:24 Z CSQ31 Mobile (BOI12_mobile) C++14
50 / 100
178 ms 7020 KB
#pragma GCC optimize("Ofast") 
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define sz(a) (int)(a.size())
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define owo ios_base::sync_with_stdio(0);cin.tie(0);
#define MOD (ll)(1e9+9)
#define INF (ll)(1e18)
#define debug(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false);\
debug("%s time : %.4fs\n", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> PII;
typedef pair<int,int> pii;
typedef vector<vector<int>> vii;
typedef vector<vector<ll>> VII;
ll gcd(ll a,ll b){if(!b)return a;else return gcd(b,a%b);}
ld x[100000],y[100000];
int main()
{
	owo
	int n;
	cin>>n;
	ld L;cin>>L;
	for(int i=0;i<n;i++){
		cin>>x[i]>>y[i];
	}
	ld l = 1,r = L;
	while(r-l>1e-4){
		ld mid = (l+r)/2;
		ld cur = 0;
		for(int i=0;i<n;i++){
			ld lf,rg;
			if(y[i] > mid){lf=1e9+5;rg=-1e9;}
			else {ld dist = sqrt(mid*mid - y[i]*y[i]);
			      lf = x[i]-dist;
			      rg = x[i]+dist;
			  }
			if(cur >=lf)cur=max(cur,rg);
		}
		if(cur >= L)r=mid;
		else l=mid;
	}
	cout<<fixed<<setprecision(4)<<l;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 0 ms 364 KB Output is correct
4 Correct 0 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 492 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 2 ms 364 KB Output is correct
4 Correct 3 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 492 KB Output is correct
2 Correct 5 ms 492 KB Output is correct
3 Correct 4 ms 492 KB Output is correct
4 Correct 7 ms 492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 492 KB Output is correct
2 Correct 5 ms 492 KB Output is correct
3 Correct 4 ms 492 KB Output is correct
4 Correct 7 ms 492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 492 KB Output is correct
2 Correct 5 ms 492 KB Output is correct
3 Correct 4 ms 492 KB Output is correct
4 Correct 8 ms 504 KB Output is correct
5 Correct 5 ms 492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 63 ms 2668 KB Output is correct
2 Correct 74 ms 2796 KB Output is correct
3 Correct 41 ms 2028 KB Output is correct
4 Correct 112 ms 2668 KB Output is correct
5 Correct 44 ms 1900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 80 ms 2852 KB Output is correct
2 Correct 99 ms 2540 KB Output is correct
3 Correct 106 ms 2884 KB Output is correct
4 Correct 114 ms 2796 KB Output is correct
5 Correct 136 ms 2992 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 74 ms 3156 KB Output is correct
2 Correct 80 ms 2924 KB Output is correct
3 Correct 65 ms 3052 KB Output is correct
4 Correct 171 ms 3436 KB Output is correct
5 Correct 101 ms 3308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 102 ms 3436 KB Output is correct
2 Correct 96 ms 3436 KB Output is correct
3 Correct 74 ms 3436 KB Output is correct
4 Correct 175 ms 3564 KB Output is correct
5 Correct 131 ms 3436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 107 ms 3436 KB Output is correct
2 Correct 96 ms 3416 KB Output is correct
3 Correct 73 ms 3436 KB Output is correct
4 Correct 178 ms 3436 KB Output is correct
5 Correct 131 ms 3564 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 51 ms 6764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 66 ms 6764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 52 ms 6764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 72 ms 6764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 52 ms 7020 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 68 ms 6764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 56 ms 6816 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 69 ms 6764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 53 ms 6764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 65 ms 6764 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -