답안 #973935

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
973935 2024-05-02T13:12:54 Z andrewp Mobile (BOI12_mobile) C++14
50 / 100
35 ms 5560 KB
//Dedicated to my love,ivaziva
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg(x) cerr<<#x<<": "<<x<<endl;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ldb double
const ll inf=(ll)1e18+5;
const int mod=1e9+7;
const int K=512;
const int L=30;
const int N=1e5+1;
ll n,l;
pll a[N];
int main()
{
    scanf("%lld%lld",&n,&l);
	for(int i=0;i<n;i++) scanf("%lld%lld",&a[i].fi,&a[i].se);
	ldb bot=1,top=(ldb)1.5e9;
	while(top-bot>1e-3)
    {
		ldb mid=(bot+top)/2.0;
		ldb calc=0;
		for(int i=0;i<n;i++)
		{
			ldb razl=sqrt(mid*mid-a[i].se*a[i].se);
			ldb x=a[i].fi-razl;
			ldb y=a[i].fi+razl;
			if(x<=calc)
            {
                calc=max(calc,y);
            }
		}
		if(calc>=l) top=mid;
		else bot=mid;
	}
	cout<<fixed<<setprecision(4)<<bot;
    return 0;
}

Compilation message

mobile.cpp: In function 'int main()':
mobile.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |     scanf("%lld%lld",&n,&l);
      |     ~~~~~^~~~~~~~~~~~~~~~~~
mobile.cpp:25:28: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |  for(int i=0;i<n;i++) scanf("%lld%lld",&a[i].fi,&a[i].se);
      |                       ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 600 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 444 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 528 KB Output is correct
2 Correct 2 ms 344 KB Output is correct
3 Correct 3 ms 604 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
5 Correct 2 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 2396 KB Output is correct
2 Correct 20 ms 2652 KB Output is correct
3 Correct 14 ms 1884 KB Output is correct
4 Correct 24 ms 2704 KB Output is correct
5 Correct 13 ms 1372 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 2392 KB Output is correct
2 Correct 26 ms 2216 KB Output is correct
3 Correct 24 ms 2648 KB Output is correct
4 Correct 25 ms 2652 KB Output is correct
5 Correct 29 ms 3164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 2396 KB Output is correct
2 Correct 21 ms 2652 KB Output is correct
3 Correct 22 ms 2652 KB Output is correct
4 Correct 35 ms 3932 KB Output is correct
5 Correct 25 ms 2652 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 3416 KB Output is correct
2 Correct 26 ms 3164 KB Output is correct
3 Correct 25 ms 2904 KB Output is correct
4 Correct 35 ms 3772 KB Output is correct
5 Correct 32 ms 3164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 3420 KB Output is correct
2 Correct 27 ms 3204 KB Output is correct
3 Correct 25 ms 2908 KB Output is correct
4 Correct 34 ms 3932 KB Output is correct
5 Correct 30 ms 3164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 16 ms 2836 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 18 ms 5460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 16 ms 2968 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 21 ms 5560 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 16 ms 2940 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 17 ms 5468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 16 ms 2932 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 28 ms 5460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 18 ms 2904 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 3880 KB Output is correct
2 Incorrect 15 ms 3420 KB Output isn't correct
3 Halted 0 ms 0 KB -