Submission #965010

# Submission time Handle Problem Language Result Execution time Memory
965010 2024-04-18T03:00:23 Z pcc Mobile (BOI12_mobile) C++17
50 / 100
1000 ms 64424 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<50;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 460 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 1 ms 464 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 600 KB Output is correct
2 Correct 5 ms 604 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 3 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 796 KB Output is correct
2 Correct 8 ms 876 KB Output is correct
3 Correct 11 ms 792 KB Output is correct
4 Correct 5 ms 828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 796 KB Output is correct
2 Correct 8 ms 828 KB Output is correct
3 Correct 11 ms 792 KB Output is correct
4 Correct 6 ms 828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 972 KB Output is correct
2 Correct 8 ms 828 KB Output is correct
3 Correct 15 ms 1004 KB Output is correct
4 Correct 5 ms 832 KB Output is correct
5 Correct 6 ms 800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 98 ms 6792 KB Output is correct
2 Correct 227 ms 7072 KB Output is correct
3 Correct 142 ms 5328 KB Output is correct
4 Correct 83 ms 7092 KB Output is correct
5 Correct 72 ms 4940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 108 ms 6740 KB Output is correct
2 Correct 96 ms 6728 KB Output is correct
3 Correct 95 ms 7068 KB Output is correct
4 Correct 83 ms 7156 KB Output is correct
5 Correct 75 ms 7604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 163 ms 6904 KB Output is correct
2 Correct 267 ms 7448 KB Output is correct
3 Correct 328 ms 7068 KB Output is correct
4 Correct 66 ms 8144 KB Output is correct
5 Correct 122 ms 7084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 271 ms 7904 KB Output is correct
2 Correct 329 ms 7940 KB Output is correct
3 Correct 431 ms 7360 KB Output is correct
4 Correct 61 ms 9056 KB Output is correct
5 Correct 119 ms 7568 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 187 ms 8120 KB Output is correct
2 Correct 348 ms 7744 KB Output is correct
3 Correct 383 ms 7400 KB Output is correct
4 Correct 66 ms 8208 KB Output is correct
5 Correct 134 ms 7604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 881 ms 29432 KB Output is correct
2 Execution timed out 1038 ms 32596 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1051 ms 33352 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1039 ms 43580 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1076 ms 46924 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1010 ms 47360 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1022 ms 52552 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1010 ms 51772 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1018 ms 57828 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1072 ms 56776 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1008 ms 64424 KB Time limit exceeded
2 Halted 0 ms 0 KB -