Submission #919296

# Submission time Handle Problem Language Result Execution time Memory
919296 2024-01-31T14:36:18 Z hqminhuwu Mobile (BOI12_mobile) C++14
60 / 100
564 ms 16436 KB
#include <bits/stdc++.h>
#define forr(_a,_b,_c) for(_a = (_b); _a <= (_c); ++_a)
#define ford(_a,_b,_c) for(_a = (_b) + 1; _a --> (_c);)
#define forf(_a,_b,_c) for(_a = (_b); _a < (_c); ++_a)
#define st first
#define nd second
#define ll long long
#define ull unsigned long long
#define pii pair <int,int>
#define pll pair <ll,ll>
#define piii pair <int,pii>
#define vi vector <int>
#define pb push_back
#define mp make_pair
#define all(x) begin(x),end(x)
#define file "test"


using namespace std;
const int N = 5e5 + 5;
const ll oo = 1e9;
const ll mod = 1e9 + 7;

int n, ff, i;
pll a[N];

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	#ifdef hqm
	   freopen(file".inp", "r", stdin); freopen(file".out", "w", stdout);
	#endif

	cin >> n >> ff;

	forr (i, 1, n)
		cin >> a[i].st >> a[i].nd;
	
	double l = 1, r = 2 * oo;
	int cnt = 100;
	while (cnt--){
		double mid = (r + l) / 2, qq = 0;
		forr (i, 1, n){
			double dis = sqrt(mid * mid - a[i].nd * a[i].nd);
			if ((double) a[i].st - dis <= qq)
				qq = max (qq, (double) a[i].st + dis);
		}
		if (qq >= ff)
			r = mid;
		else l = mid;
	}

	cout << fixed << setprecision(5) << l;
	return 0;
}
/*



*/

# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 544 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 504 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 2 ms 344 KB Output is correct
3 Correct 2 ms 344 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 348 KB Output is correct
2 Correct 3 ms 600 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 3 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 4 ms 600 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 3 ms 500 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
5 Correct 3 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 74 ms 2648 KB Output is correct
2 Correct 40 ms 2692 KB Output is correct
3 Correct 28 ms 2648 KB Output is correct
4 Correct 50 ms 2672 KB Output is correct
5 Correct 27 ms 2648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 50 ms 2648 KB Output is correct
2 Correct 45 ms 2920 KB Output is correct
3 Correct 47 ms 2680 KB Output is correct
4 Correct 49 ms 2900 KB Output is correct
5 Correct 51 ms 2668 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 2652 KB Output is correct
2 Correct 41 ms 2648 KB Output is correct
3 Correct 39 ms 2652 KB Output is correct
4 Correct 72 ms 2688 KB Output is correct
5 Correct 51 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 44 ms 2648 KB Output is correct
2 Correct 46 ms 2668 KB Output is correct
3 Correct 49 ms 2648 KB Output is correct
4 Correct 63 ms 2672 KB Output is correct
5 Correct 61 ms 2672 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 46 ms 2652 KB Output is correct
2 Correct 45 ms 2648 KB Output is correct
3 Correct 47 ms 2684 KB Output is correct
4 Correct 71 ms 2672 KB Output is correct
5 Correct 55 ms 2648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 217 ms 8304 KB Output is correct
2 Correct 236 ms 8256 KB Output is correct
3 Correct 236 ms 8052 KB Output is correct
4 Correct 328 ms 8260 KB Output is correct
5 Correct 299 ms 8264 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 229 ms 8256 KB Output is correct
2 Correct 564 ms 8264 KB Output is correct
3 Correct 238 ms 8264 KB Output is correct
4 Correct 313 ms 8304 KB Output is correct
5 Correct 308 ms 8272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 52 ms 8208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 73 ms 16436 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 52 ms 8048 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 77 ms 16260 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 51 ms 8052 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 72 ms 16316 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 52 ms 8056 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 74 ms 16208 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -