A题水的一批,问你去掉一个点,剩下的点能不能满足都在y轴一侧
B题测试数据超级水,用java随便加了个长度的限制,就蒙过了。给你三个数a,b,c,问你a/b的小数点后第几位是c
C题,大部分时间都用来调这个题了,如果我没理解错的话,意思就是给你n个数,问你去掉那个数之后,是的剩下的数列中最长上升子序列最大,我用O(nlogn)的一直wa在中间一组测试数据,调通后补发
You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis.
The first line contains a single positive integer n (2 ≤ n ≤ 105).
The following n lines contain coordinates of the points. The i-th of these lines contains two single integers xi and yi (|xi|, |yi| ≤ 109, xi ≠ 0). No two points coincide.
Print "Yes" if there is such a point, "No" — otherwise.
You can print every letter in any case (upper or lower).
3 1 1 -1 -1 2 -1
Yes
4 1 1 2 2 -1 1 -2 2
No
3 1 2 2 1 4 60
Yes
In the first example the second point can be removed.
In the second example there is no suitable for the condition point.
In the third example any point can be removed.
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
#define ll long long
#define MOD 1000000007
#define N 100005
//ll map[N][2];
int n;
int x=0,y=0;
int main()
{
ll a,b;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%I64d%I64d",&a,&b);
if(a>0)
{
x++;
}
}
if(x==n||x==n-1||x==0||x==1)
cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}