Submission #906110

# Submission time Handle Problem Language Result Execution time Memory
906110 2024-01-13T14:05:26 Z Nonoze Mobile (BOI12_mobile) C++17
0 / 100
480 ms 22868 KB
#include <bits/stdc++.h>

#define int long long
#define sz(x) (int)(x.size())

using namespace std;

int n, L;
vector<pair<double, double>> a;

long double dist(long double x1, pair<long double, long double> other) {
	long double y1=0;
	long double x2=other.first, y2=other.second;
	return ((long double)sqrt((long double)((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))));
}

void solve() {
	cin >> n >> L;
	a.clear();
	a.resize(n);
	for (auto &u: a) cin >> u.first >> u.second;
	double ans=0;
	double l=0, r=1e9;
	while (r-l>=0.0001) {
		double mid=(l+r)/2;
		double borne=0;
		for (int i=0; i<n; i++) {
			double x=a[i].first, y=a[i].second;
			double dist=sqrt((double)(mid*mid-y*y));
			if (x-dist<=borne) borne+=x+dist;
		}
		if (borne>=L) {
			ans=mid;
			r=mid-0.0001;
		}
		else l=mid+0.0001;
	}
	cout << fixed << setprecision(4) << ans << endl;
	return;
}


signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	solve();
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 1624 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 1672 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 1628 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 56 ms 2008 KB Output is correct
2 Correct 55 ms 2824 KB Output is correct
3 Correct 46 ms 1884 KB Output is correct
4 Incorrect 55 ms 2036 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 48 ms 2012 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 212 ms 8280 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 258 ms 8284 KB Output is correct
2 Incorrect 234 ms 11704 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 264 ms 9840 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 290 ms 10068 KB Output is correct
2 Incorrect 294 ms 13904 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 298 ms 11408 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 334 ms 11352 KB Output is correct
2 Incorrect 326 ms 16268 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 330 ms 12976 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 389 ms 12976 KB Output is correct
2 Incorrect 375 ms 18600 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 425 ms 16104 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 480 ms 16108 KB Output is correct
2 Incorrect 459 ms 22868 KB Output isn't correct
3 Halted 0 ms 0 KB -