Submission #1098733

# Submission time Handle Problem Language Result Execution time Memory
1098733 2024-10-09T19:34:24 Z sano Mobile (BOI12_mobile) C++14
80 / 100
888 ms 29748 KB
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<fstream>
#include<algorithm>
#include <iomanip>
#include<map>
#include <set>
#include <unordered_map>
#include <stack>
#include <unordered_set>
#include <cmath>
#define ll long long
#define For(i, n) for(int i = 0; i < (int)n; i++)
#define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++)
#define rfor(i, n) for(int i = (int)n; i >= (int)0; i--)
#define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--)
#define vec vector
#define ff first
#define ss second
#define pb push_back
#define shit short int
#define pii pair<double, double>
#define NEK 2147483640
#define mod 1000000007
#define mod2 1000000009
#define rsz resize 
#define prv1 43
#define prv2 47
#define D 8

using namespace std;

int main() {
	double n, asd;
	cin >> n >> asd;
	vec<pii> p;
	For(i, n) {
		double x, y;
		cin >> x >> y;
		x *= 1000; y *= 1000;
		if (p.size() > 0) {
			if (x == p.back().ff && y > 0 && p.back().ss > 0) continue;
			if (x == p.back().ff && y < 0) p.pop_back();
		}
		p.push_back({ x, y });
	}
	ll l = 0;
	ll r = 1414213570000;
	asd *= 1000;
	while (l < r) {
		double mid = (l + r) / 2;
		double k = 0;
		For(i, p.size()) {
			double jeden = mid * mid;
			double dva = p[i].second * p[i].second;
			double tri = jeden - dva;
			double d = sqrt(tri);
			double s = p[i].ff - d;
			double e = p[i].ff + d;
			if (s > k) continue;
			k = max(k, e);
		}
		if (k >= asd) r = mid;
		else l = mid + 1;
	}
	cout << fixed << setprecision(4);
	long double l2 = l;
	l2 /= 1000;
	cout << l2 << '\n';
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 540 KB Output is correct
2 Correct 4 ms 604 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 4 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 348 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 4 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 604 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 4 ms 544 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 49 ms 2504 KB Output is correct
2 Correct 56 ms 1488 KB Output is correct
3 Correct 33 ms 1492 KB Output is correct
4 Correct 68 ms 2504 KB Output is correct
5 Correct 20 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 37 ms 708 KB Output is correct
2 Correct 45 ms 1436 KB Output is correct
3 Correct 60 ms 2592 KB Output is correct
4 Correct 60 ms 2504 KB Output is correct
5 Correct 88 ms 2364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 46 ms 2512 KB Output is correct
2 Correct 52 ms 1536 KB Output is correct
3 Incorrect 50 ms 2592 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 66 ms 1456 KB Output is correct
2 Correct 61 ms 1480 KB Output is correct
3 Correct 51 ms 728 KB Output is correct
4 Correct 84 ms 2504 KB Output is correct
5 Correct 67 ms 2508 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 2516 KB Output is correct
2 Correct 61 ms 1480 KB Output is correct
3 Correct 62 ms 716 KB Output is correct
4 Correct 102 ms 2496 KB Output is correct
5 Correct 68 ms 2464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 274 ms 8632 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 295 ms 596 KB Output is correct
2 Correct 397 ms 8632 KB Output is correct
3 Correct 266 ms 2500 KB Output is correct
4 Correct 410 ms 8632 KB Output is correct
5 Correct 371 ms 8632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 326 ms 16812 KB Output is correct
2 Correct 343 ms 436 KB Output is correct
3 Correct 333 ms 596 KB Output is correct
4 Correct 506 ms 16808 KB Output is correct
5 Correct 376 ms 8632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 340 ms 592 KB Output is correct
2 Correct 454 ms 16820 KB Output is correct
3 Correct 295 ms 2500 KB Output is correct
4 Correct 513 ms 16788 KB Output is correct
5 Correct 424 ms 16816 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 387 ms 16812 KB Output is correct
2 Correct 428 ms 596 KB Output is correct
3 Correct 449 ms 616 KB Output is correct
4 Correct 665 ms 16812 KB Output is correct
5 Correct 459 ms 8632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 487 ms 528 KB Output is correct
2 Correct 587 ms 16840 KB Output is correct
3 Correct 373 ms 2580 KB Output is correct
4 Correct 624 ms 16844 KB Output is correct
5 Correct 575 ms 16784 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 427 ms 16756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 504 ms 676 KB Output is correct
2 Correct 701 ms 16808 KB Output is correct
3 Correct 398 ms 2424 KB Output is correct
4 Correct 805 ms 16880 KB Output is correct
5 Correct 686 ms 16812 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 577 ms 16808 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 616 ms 596 KB Output is correct
2 Correct 820 ms 16956 KB Output is correct
3 Correct 545 ms 4548 KB Output is correct
4 Correct 888 ms 16904 KB Output is correct
5 Correct 763 ms 29748 KB Output is correct