【Codeforces Round #450 (Div. 2) A】Find Extra One

【链接】 我是链接,点我呀:)
【题意】

在这里输入题意

【题解】

模拟。 看看Y左边或右边的点个数是否<=1

【代码】

#include <bits/stdc++.h>
using namespace std;

const int N = 1e5;

int a[N+10];

int main(){
	#ifdef LOCAL_DEFINE
	    freopen("F:\\c++source\\rush_in.txt", "r", stdin);
	#endif
	ios::sync_with_stdio(0),cin.tie(0);
	int n;
	cin >> n;
	for (int i = 1;i <= n;i++){
	int y;
		cin >> a[i]; cin>>y;

	}
	sort(a+1,a+1+n);
	if (a[n]<0 || a[1] > 0 || (a[1]<0 && a[2]>0) ||(a[n]>0 && a[n-1]<0)){
	 	cout <<"Yes"<<endl;	
	}else{
	 	cout <<"No"<<endl;
	}
	return 0;
}
posted @ 2017-12-12 03:37  AWCXV  阅读(151)  评论(0)    收藏  举报