Submission #321584

# Submission time Handle Problem Language Result Execution time Memory
321584 2020-11-12T19:50:08 Z CSQ31 Mobile (BOI12_mobile) C++14
60 / 100
1000 ms 41196 KB
#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);}
int main()
{
	owo
	int n;
	cin>>n;
	ld L;cin>>L;
	vector<ld>x(n),y(n);
	for(int i=0;i<n;i++){
		cin>>x[i]>>y[i];
	}
	ld l = 1,r = 1e9+2;
	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 1 ms 364 KB Output is correct
4 Correct 1 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 4 ms 364 KB Output is correct
2 Correct 3 ms 364 KB Output is correct
3 Correct 3 ms 364 KB Output is correct
4 Correct 4 ms 492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 492 KB Output is correct
2 Correct 6 ms 524 KB Output is correct
3 Correct 5 ms 492 KB Output is correct
4 Correct 8 ms 492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 492 KB Output is correct
2 Correct 6 ms 492 KB Output is correct
3 Correct 5 ms 492 KB Output is correct
4 Correct 9 ms 492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 620 KB Output is correct
2 Correct 6 ms 492 KB Output is correct
3 Correct 5 ms 492 KB Output is correct
4 Correct 9 ms 492 KB Output is correct
5 Correct 7 ms 492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 76 ms 2668 KB Output is correct
2 Correct 84 ms 2928 KB Output is correct
3 Correct 52 ms 2028 KB Output is correct
4 Correct 128 ms 2796 KB Output is correct
5 Correct 62 ms 1900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 101 ms 2796 KB Output is correct
2 Correct 106 ms 2668 KB Output is correct
3 Correct 130 ms 2924 KB Output is correct
4 Correct 132 ms 2796 KB Output is correct
5 Correct 150 ms 3052 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 97 ms 3052 KB Output is correct
2 Correct 92 ms 2924 KB Output is correct
3 Correct 82 ms 2924 KB Output is correct
4 Correct 186 ms 3436 KB Output is correct
5 Correct 127 ms 3180 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 110 ms 3656 KB Output is correct
2 Correct 108 ms 3436 KB Output is correct
3 Correct 97 ms 3564 KB Output is correct
4 Correct 186 ms 3564 KB Output is correct
5 Correct 156 ms 3436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 3436 KB Output is correct
2 Correct 109 ms 3436 KB Output is correct
3 Correct 97 ms 3436 KB Output is correct
4 Correct 191 ms 3436 KB Output is correct
5 Correct 156 ms 3436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 523 ms 16108 KB Output is correct
2 Correct 559 ms 24248 KB Output is correct
3 Correct 549 ms 23276 KB Output is correct
4 Correct 936 ms 25580 KB Output is correct
5 Correct 806 ms 22956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 542 ms 16144 KB Output is correct
2 Correct 547 ms 22636 KB Output is correct
3 Correct 488 ms 21868 KB Output is correct
4 Correct 920 ms 25324 KB Output is correct
5 Correct 826 ms 23404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 630 ms 19180 KB Output is correct
2 Correct 665 ms 28524 KB Output is correct
3 Correct 655 ms 28012 KB Output is correct
4 Execution timed out 1099 ms 31084 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 650 ms 19308 KB Output is correct
2 Correct 648 ms 27280 KB Output is correct
3 Correct 580 ms 25964 KB Output is correct
4 Execution timed out 1095 ms 30828 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 727 ms 22380 KB Output is correct
2 Correct 767 ms 33260 KB Output is correct
3 Correct 759 ms 32620 KB Output is correct
4 Execution timed out 1094 ms 35820 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 761 ms 22380 KB Output is correct
2 Correct 738 ms 31724 KB Output is correct
3 Correct 683 ms 30700 KB Output is correct
4 Execution timed out 1094 ms 35820 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 826 ms 25452 KB Output is correct
2 Correct 892 ms 37996 KB Output is correct
3 Correct 867 ms 37228 KB Output is correct
4 Execution timed out 1060 ms 41196 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 874 ms 25452 KB Output is correct
2 Correct 846 ms 36076 KB Output is correct
3 Correct 779 ms 35052 KB Output is correct
4 Execution timed out 1030 ms 40940 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1042 ms 31724 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1053 ms 31596 KB Time limit exceeded
2 Halted 0 ms 0 KB -