Submission #965008

# Submission time Handle Problem Language Result Execution time Memory
965008 2024-04-18T02:57:19 Z pcc Mobile (BOI12_mobile) C++17
50 / 100
1000 ms 63540 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;
	for(int i = 0;i<N;i++)cin>>arr[i].fs>>arr[i].sc;
	for(int i = 0;i<60;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
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory 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 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 600 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 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 796 KB Output is correct
2 Correct 9 ms 816 KB Output is correct
3 Correct 14 ms 796 KB Output is correct
4 Correct 5 ms 824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 796 KB Output is correct
2 Correct 9 ms 812 KB Output is correct
3 Correct 16 ms 796 KB Output is correct
4 Correct 5 ms 828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 812 KB Output is correct
2 Correct 13 ms 828 KB Output is correct
3 Correct 17 ms 792 KB Output is correct
4 Correct 5 ms 812 KB Output is correct
5 Correct 7 ms 796 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 117 ms 6796 KB Output is correct
2 Correct 279 ms 7104 KB Output is correct
3 Correct 180 ms 5204 KB Output is correct
4 Correct 82 ms 7144 KB Output is correct
5 Correct 74 ms 4912 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 110 ms 6740 KB Output is correct
2 Correct 94 ms 6720 KB Output is correct
3 Correct 96 ms 7048 KB Output is correct
4 Correct 85 ms 7192 KB Output is correct
5 Correct 86 ms 7568 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 193 ms 6880 KB Output is correct
2 Correct 319 ms 7220 KB Output is correct
3 Correct 380 ms 7064 KB Output is correct
4 Correct 60 ms 8228 KB Output is correct
5 Correct 127 ms 7132 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 318 ms 7916 KB Output is correct
2 Correct 397 ms 7744 KB Output is correct
3 Correct 513 ms 7380 KB Output is correct
4 Correct 66 ms 8256 KB Output is correct
5 Correct 123 ms 7592 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 230 ms 7872 KB Output is correct
2 Correct 406 ms 7736 KB Output is correct
3 Correct 496 ms 7368 KB Output is correct
4 Correct 62 ms 8260 KB Output is correct
5 Correct 122 ms 7636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1012 ms 29668 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1036 ms 32964 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1099 ms 45008 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1048 ms 47648 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1054 ms 46896 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1052 ms 51580 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1030 ms 52432 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1090 ms 60640 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1057 ms 56788 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1040 ms 63540 KB Time limit exceeded
2 Halted 0 ms 0 KB -