답안 #865306

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
865306 2023-10-24T07:20:05 Z vjudge1 Sure Bet (CEOI17_sure) C++17
0 / 100
0 ms 344 KB
	/*Lazy propagation 21
 *
 *
 * Imansoska228
 * Imancrush
 * Imantopchik
 * .*n*.
 * Author: Imansoska
 * Slishkom slab
**/
#include <bits/stdc++.h>
using namespace std;
	
#define ll long long
#define FF first
#define SS second
#define pb push_back
#define bp pop_back()
#define pf push_front
#define int long long
#define Imansoska ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define endl cout << "\n"
//#define input cin 
//#define print cout
	
const int N = 1e5 + 13 ;
const int maxn= 1e6+100;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int ima = 1e4 + 10;

int n;
double z[100010] , s[100010];
double g1 , g2;

signed main (/*Imansoska*/) {
	Imansoska
//	freopen("lepus.in","r",stdin);
//	freopen("lepus.out","w",stdout);
	cin >> n;
	for ( int i=1; i<=n; i++ ) {
		cin >> z[i] >> s[i];
	}
	sort( z+1 , z+1+n );
	sort( s+1 , s+1+n );
	int l=1 , r=1 ;
	double mx=-9999;
	g1=z[n]-2;
	g2=s[n]-2;
	for ( int i=1; i<=n*2; i++ ) {
		if ( g1<g2 ) {
			g1+=z[n-l]-1;
			g2-=1;
			l++;
		}
		if ( g2<g1 ) {
			g2+=s[n-r]-1;
			r++;
			g1-=1;
		}
		mx=max(mx , min(g1 , g2));
	}
	printf("%.4lf",(double)mx);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -