Submission #460579

# Submission time Handle Problem Language Result Execution time Memory
460579 2021-08-09T07:40:06 Z shivensinha4 Mobile (BOI12_mobile) C++17
22 / 100
1000 ms 48108 KB
#include <bits/stdc++.h>
#ifdef mlocal
#include "./Competitive-Code-Library/snippets/prettyprint.h"
#endif
using namespace std;
#define for_(i, s, e) for (int i = s; i < (int) e; i++)
#define for__(i, s, e) for (ll i = s; i < e; i++)
typedef double ll;
typedef vector<int> vi;
typedef array<ll, 2> ii;
#define endl '\n'

const ll K = 1e5;

int main() {
#ifdef mlocal
	freopen("test.in", "r", stdin);
#endif
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	ll n, len; cin >> n >> len;
	len *= K;
	vector<ii> pts(n);
	for_(i, 0, n) {
		for_(j, 0, 2) {
			cin >> pts[i][j];
			pts[i][j] *= K;
		}
	}
	
	ll l = 0, r = 1e15, ans = l;
	while (l < r) {
		ll mid = (l+r)/2;
		bool hole = false;
		vector<ii> seg;
		for_(i, 0, n) if (mid*mid >= pts[i][1]*pts[i][1]) {
			ll sq = sqrtl(mid*mid - pts[i][1]*pts[i][1]);
			seg.push_back({pts[i][0]-sq, pts[i][0]+sq});
		}
		sort(seg.begin(),  seg.end());
		
		ll cr = 0;
		for (auto &i: seg) {
			if (cr >= len) break;
			if (i[0] <= cr) cr = max(i[1], cr);
			/*else {
				continue;
//				hole = true;
//				break;
			}*/
		}
		
		if (hole or cr < len) {
			ans = mid;
			l = mid+1;
		} else r = mid;
	}
	
	cout << fixed << setprecision(10) << ans/K << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Execution timed out 1081 ms 204 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 460 KB Output is correct
2 Correct 8 ms 460 KB Output is correct
3 Correct 5 ms 332 KB Output is correct
4 Correct 7 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 604 KB Output is correct
2 Correct 23 ms 616 KB Output is correct
3 Correct 22 ms 604 KB Output is correct
4 Correct 10 ms 616 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 12 ms 616 KB Output is correct
2 Correct 18 ms 612 KB Output is correct
3 Execution timed out 1088 ms 608 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 25 ms 604 KB Output is correct
2 Correct 18 ms 604 KB Output is correct
3 Execution timed out 1087 ms 604 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 233 ms 4908 KB Output is correct
2 Correct 434 ms 4920 KB Output is correct
3 Correct 256 ms 3048 KB Output is correct
4 Correct 170 ms 4748 KB Output is correct
5 Correct 156 ms 2920 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 219 ms 4828 KB Output is correct
2 Correct 193 ms 4580 KB Output is correct
3 Execution timed out 1086 ms 4928 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 380 ms 5284 KB Output is correct
2 Correct 460 ms 5060 KB Output is correct
3 Correct 578 ms 5028 KB Output is correct
4 Correct 170 ms 5420 KB Output is correct
5 Correct 257 ms 5168 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 551 ms 5548 KB Output is correct
2 Correct 647 ms 6928 KB Output is correct
3 Execution timed out 1052 ms 6548 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 495 ms 5680 KB Output is correct
2 Correct 652 ms 5520 KB Output is correct
3 Correct 759 ms 6540 KB Output is correct
4 Execution timed out 1084 ms 7436 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 24196 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1076 ms 24176 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1059 ms 35560 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1073 ms 35572 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1098 ms 38668 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1093 ms 38720 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1079 ms 41856 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1084 ms 41828 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1096 ms 48108 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 48040 KB Time limit exceeded
2 Halted 0 ms 0 KB -