답안 #684707

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
684707 2023-01-22T11:03:45 Z nayhz Mobile (BOI12_mobile) C++17
0 / 100
385 ms 16236 KB
// source identifier task_name
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#define lck cout << "ick bmi 32.9\n"
#define cam_cs cout << "ick orz\n"
#define orz(x) cout << (x) << " orz\n"

#define pii pair<int, int>
#define pll pair<long long, long long>
#define pcc pair<char, char>
#define ll long long
#define ull unsigned long long
#define ld long double
#define int long long

#define vi vector<int>
#define vll vector<long long>
#define vd vector<double>
#define vpii vector<pair<int, int>>
#define vpll vector<pair<long long, long long>>
#define vc vector<char>
#define vsc vector<string>
#define vb vector<bool>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define yes() cout << "Yes\n"
#define no() cout << "No\n"
#define impossible() cout << "Impossible\n"

template<typename T, typename V>
inline void print (const std::pair<T, V> &x) {std::cout << x.first << ' ' << x.second << '\n';}
template<typename T>
inline void print (const T &x) {std::cout << x << '\n';}
template<typename T>
inline void print (std::vector<T> &x) {for (auto &y : x) std::cout << y << " "; std::cout << '\n';}
inline void print () {std::cout << '\n';}
using namespace std;

const ld pi = acos(-1);
const ld eps = 1e-9;
const ll mod = 1000000007;
const ll inf = 1000000007;

clock_t T, NT;
inline double get_time() {NT = clock() - T; return (double)(NT) / CLOCKS_PER_SEC;}

void file_io (string x);

/*
>>>>>>>>>>>>>>>>>>>>>>>>>>END OF TEMPLATE HEADER<<<<<<<<<<<<<<<<<<<<<<<<
*/

void solve (/*int &tc*/) {
	int n, len; cin >> n >> len;
	vpii a(n);
	for (auto &x : a) cin >> x.fi >> x.se;

	double l = 1, r = 1.5e9, mid;
	double curr, temp, lb, rb;
	while (r - l > 1e-4) {
		mid = (l + r) / 2;
		curr = 0;

		for (int i = 0; i < n; i++) {
			temp = sqrt(mid * mid - a[i].se * a[i].se);
			lb = a[i].fi - temp, rb = a[i].fi + temp;

			if (lb <= curr) curr = rb;
			if (curr >= len) break;
		}
		if (curr >= len) r = mid;
		else l = mid;
	}
	cout << fixed << setprecision(4) << l << '\n';
}

signed main () {
	cin.tie(0)->sync_with_stdio(false);
	T = clock();
	srand(time(NULL));
	// file_io("");

	int t = 1;
	// cin >> t;
	for (int i = 1; i <= t; i++) {
		solve(/*i*/);
		// if (i != t) cout << '\n';
	}
	// while (true) {solve(t); t++;}
	return 0;
}

// void file_io (string x = "x") {
// 	string i = x + ".in";
// 	freopen(i.c_str(), "r", stdin);
// 	string o = x + ".out";
// 	freopen(o.c_str(), "w", stdout);
// }
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Incorrect 2 ms 340 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 27 ms 1492 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 19 ms 1592 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 1740 KB Output is correct
2 Correct 19 ms 1628 KB Output is correct
3 Correct 16 ms 1620 KB Output is correct
4 Incorrect 36 ms 1876 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 1936 KB Output is correct
2 Correct 21 ms 1876 KB Output is correct
3 Correct 23 ms 1876 KB Output is correct
4 Incorrect 40 ms 1876 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 1916 KB Output is correct
2 Correct 22 ms 1876 KB Output is correct
3 Correct 22 ms 1876 KB Output is correct
4 Incorrect 36 ms 1996 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 113 ms 8164 KB Output is correct
2 Correct 115 ms 8148 KB Output is correct
3 Correct 103 ms 8148 KB Output is correct
4 Incorrect 181 ms 8148 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 113 ms 8164 KB Output is correct
2 Incorrect 211 ms 8148 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 132 ms 9708 KB Output is correct
2 Correct 125 ms 9700 KB Output is correct
3 Correct 125 ms 9704 KB Output is correct
4 Incorrect 232 ms 9848 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 135 ms 9720 KB Output is correct
2 Incorrect 240 ms 9728 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 149 ms 11272 KB Output is correct
2 Correct 155 ms 11280 KB Output is correct
3 Correct 140 ms 11276 KB Output is correct
4 Incorrect 249 ms 11304 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 159 ms 11324 KB Output is correct
2 Incorrect 274 ms 11340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 168 ms 12984 KB Output is correct
2 Correct 177 ms 13016 KB Output is correct
3 Correct 174 ms 12840 KB Output is correct
4 Incorrect 286 ms 12852 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 185 ms 12864 KB Output is correct
2 Incorrect 320 ms 12844 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 214 ms 16236 KB Output is correct
2 Correct 194 ms 16076 KB Output is correct
3 Correct 216 ms 15972 KB Output is correct
4 Incorrect 355 ms 15956 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 240 ms 16056 KB Output is correct
2 Incorrect 385 ms 15984 KB Output isn't correct
3 Halted 0 ms 0 KB -