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;
}