답안 #965012

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
965012 2024-04-18T03:02:49 Z pcc Mobile (BOI12_mobile) C++17
50 / 100
358 ms 8244 KB
#include <bits/stdc++.h>
using namespace std;

#pragma GCC optimize("O3,unroll-loop")
#pragma GCC target("avx2,popcnt,sse4")

#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
#define ld double
#define pld pair<ld,ld>

const int mxn = 1e6+10;
ll N,L;
pair<ll,ll> arr[mxn];

inline bool check(ld r){
	vector<pld> v;
	for(int i = 0;i<N;i++){
		if(r<abs(arr[i].sc))continue;
		v.push_back(pld(arr[i].fs-sqrt(r*r-arr[i].sc*arr[i].sc),arr[i].fs+sqrt(r*r-arr[i].sc*arr[i].sc)));
	}
	sort(v.begin(),v.end());
	ld pre = 0;
	for(auto &i:v){
		if(pre>L)return true;
		if(pre<i.fs)return false;
		pre = max(pre,i.sc);
	}
	return pre>L;
}

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ld l = 0,r = 2e9;
	cin>>N>>L;
  if(N>1e5)exit(0);
	for(int i = 0;i<N;i++)cin>>arr[i].fs>>arr[i].sc;
	for(int i = 0;i<45;i++){
		ld mid = (l+r)/2;
		if(check(mid))r = mid;
		else l = mid;
	}
	cout<<fixed<<setprecision(10)<<l<<'\n';
	return 0;
}

Compilation message

mobile.cpp:4:38: warning: bad option '-funroll-loop' to pragma 'optimize' [-Wpragmas]
    4 | #pragma GCC optimize("O3,unroll-loop")
      |                                      ^
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
    5 | #pragma GCC target("avx2,popcnt,sse4")
      |                                      ^
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning: bad option '-funroll-loop' to attribute 'optimize' [-Wattributes]
mobile.cpp:5:38: warning
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 504 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 344 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 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 476 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 3 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 792 KB Output is correct
2 Correct 8 ms 828 KB Output is correct
3 Correct 12 ms 792 KB Output is correct
4 Correct 5 ms 824 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 804 KB Output is correct
2 Correct 8 ms 828 KB Output is correct
3 Correct 10 ms 800 KB Output is correct
4 Correct 5 ms 828 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 812 KB Output is correct
2 Correct 8 ms 824 KB Output is correct
3 Correct 11 ms 792 KB Output is correct
4 Correct 5 ms 812 KB Output is correct
5 Correct 7 ms 796 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 105 ms 6740 KB Output is correct
2 Correct 225 ms 7120 KB Output is correct
3 Correct 126 ms 5184 KB Output is correct
4 Correct 78 ms 7108 KB Output is correct
5 Correct 73 ms 4940 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 118 ms 6728 KB Output is correct
2 Correct 97 ms 6644 KB Output is correct
3 Correct 99 ms 7052 KB Output is correct
4 Correct 88 ms 7188 KB Output is correct
5 Correct 76 ms 7576 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 155 ms 6848 KB Output is correct
2 Correct 244 ms 7276 KB Output is correct
3 Correct 281 ms 7100 KB Output is correct
4 Correct 61 ms 8244 KB Output is correct
5 Correct 122 ms 7084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 252 ms 7900 KB Output is correct
2 Correct 288 ms 8220 KB Output is correct
3 Correct 358 ms 7676 KB Output is correct
4 Correct 64 ms 8220 KB Output is correct
5 Correct 130 ms 7584 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 193 ms 7880 KB Output is correct
2 Correct 306 ms 7732 KB Output is correct
3 Correct 351 ms 7380 KB Output is correct
4 Correct 69 ms 8212 KB Output is correct
5 Correct 122 ms 7592 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 604 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 352 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -