답안 #1104588

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1104588 2024-10-24T05:59:24 Z EkinOnal Mobile (BOI12_mobile) C++17
100 / 100
357 ms 35400 KB
//#pragma GCC optimize("O3,unroll-loops,Ofast")
//#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
 
#define MAX 200005
#define pb push_back
#define mp make_pair 
#define int long long
#define f first
#define s second
#define vi vector<int>
#define pii pair<int,int>
#define si set<int>
#define vpii vector<pair<int,int>> 
const int mod = 1e9+7;
const int INF = 1e18;
// myMap.begin()->first :  key
// myMap.begin()->second : value
//#define double double

int epow(int a,int b){int ans=1;while(b){if(b&1) ans*=a;a*=a;b>>=1;a%=mod;ans%=mod;}return ans%=mod;}
int gcd(int a,int b) {if(a<b)swap(a,b);while(b){int tmp=b;b=a%b;a=tmp;}return a;}
int mul(long long a,long long b){return ((a%mod)*(b%mod))%mod;}
int sum(long long a,long long b){return ((a%mod)+(b%mod))%mod;}
// typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
// typedef  
// tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_multiset;


void solve(){
	int n,L; cin>>n>>L;
	vpii v(n+2); for(int i=1;i<=n;i++) cin>>v[i].f>>v[i].s;

	double l=0,r=2e9;
	while(r-l>1e-6){
		vector<pair<double,double>> arr;
		double mid=(l+r)/2.0;

		double mx=0.0;
		for(int i=1;i<=n;i++){
			if(v[i].s*v[i].s>mid*mid) continue;
			double a = sqrt(mid*mid-v[i].s*v[i].s);

			double l=v[i].f-a,r=v[i].f+a; 
			if(l<=mx) mx=max(mx,r);
		}	

		if(mx<(double)L) l=mid;
		else r=mid;
	}
	cout << fixed << setprecision(6);
	cout<<l<<endl;

  	

	return;
}
 
int32_t main(/*int32_t argc, char* argv[]*/){
	ios_base::sync_with_stdio(0); cin.tie(0);
	// freopen("dining.in", "r", stdin);
	// freopen("dining.out", "w", stdout);		
 
	int t=1;
//	cin >> t;
	while (t--) solve();
 
	return 0;	 			
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 336 KB Output is correct
2 Correct 2 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 336 KB Output is correct
2 Correct 3 ms 592 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 336 KB Output is correct
2 Correct 2 ms 336 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 3 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 508 KB Output is correct
2 Correct 2 ms 608 KB Output is correct
3 Correct 2 ms 508 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
5 Correct 2 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 1616 KB Output is correct
2 Correct 21 ms 1664 KB Output is correct
3 Correct 14 ms 1872 KB Output is correct
4 Correct 17 ms 1616 KB Output is correct
5 Correct 10 ms 1104 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 1616 KB Output is correct
2 Correct 18 ms 2128 KB Output is correct
3 Correct 18 ms 1616 KB Output is correct
4 Correct 18 ms 3068 KB Output is correct
5 Correct 21 ms 2644 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 1616 KB Output is correct
2 Correct 23 ms 2384 KB Output is correct
3 Correct 21 ms 2640 KB Output is correct
4 Correct 23 ms 2016 KB Output is correct
5 Correct 20 ms 2384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 1872 KB Output is correct
2 Correct 28 ms 2896 KB Output is correct
3 Correct 24 ms 3072 KB Output is correct
4 Correct 23 ms 1872 KB Output is correct
5 Correct 23 ms 3288 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 1872 KB Output is correct
2 Correct 30 ms 1872 KB Output is correct
3 Correct 24 ms 2896 KB Output is correct
4 Correct 30 ms 3664 KB Output is correct
5 Correct 22 ms 1872 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 126 ms 10568 KB Output is correct
2 Correct 138 ms 14200 KB Output is correct
3 Correct 132 ms 15432 KB Output is correct
4 Correct 119 ms 17740 KB Output is correct
5 Correct 108 ms 14920 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 152 ms 12104 KB Output is correct
2 Correct 228 ms 14648 KB Output is correct
3 Correct 133 ms 13896 KB Output is correct
4 Correct 111 ms 17480 KB Output is correct
5 Correct 108 ms 15300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 145 ms 9976 KB Output is correct
2 Correct 178 ms 17116 KB Output is correct
3 Correct 158 ms 18276 KB Output is correct
4 Correct 137 ms 21576 KB Output is correct
5 Correct 132 ms 17764 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 180 ms 9808 KB Output is correct
2 Correct 241 ms 17628 KB Output is correct
3 Correct 146 ms 16456 KB Output is correct
4 Correct 153 ms 21320 KB Output is correct
5 Correct 135 ms 18404 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 200 ms 11344 KB Output is correct
2 Correct 212 ms 21840 KB Output is correct
3 Correct 206 ms 21324 KB Output is correct
4 Correct 175 ms 24048 KB Output is correct
5 Correct 150 ms 20296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 187 ms 11344 KB Output is correct
2 Correct 259 ms 20308 KB Output is correct
3 Correct 161 ms 19972 KB Output is correct
4 Correct 192 ms 24392 KB Output is correct
5 Correct 146 ms 21320 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 199 ms 12880 KB Output is correct
2 Correct 215 ms 25120 KB Output is correct
3 Correct 214 ms 24392 KB Output is correct
4 Correct 174 ms 28488 KB Output is correct
5 Correct 168 ms 23960 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 210 ms 12972 KB Output is correct
2 Correct 314 ms 22600 KB Output is correct
3 Correct 207 ms 21576 KB Output is correct
4 Correct 206 ms 28232 KB Output is correct
5 Correct 175 ms 24392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 247 ms 15952 KB Output is correct
2 Correct 291 ms 31560 KB Output is correct
3 Correct 276 ms 30556 KB Output is correct
4 Correct 233 ms 35040 KB Output is correct
5 Correct 222 ms 29512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 263 ms 16432 KB Output is correct
2 Correct 357 ms 27492 KB Output is correct
3 Correct 237 ms 28232 KB Output is correct
4 Correct 222 ms 35400 KB Output is correct
5 Correct 228 ms 30792 KB Output is correct