当前位置:网站首页>AcWing 4299. Delete point
AcWing 4299. Delete point
2022-07-06 22:56:00 【GHOSTANDBREAD】
In a two-dimensional plane there is nn A little bit , None of these points are located in yy On the shaft .
Please judge whether there is any satisfaction in these points , After deleting this point , All the remaining points are in yy Same side of shaft .
Input format
The first line contains integers nn.
Next nn That's ok , Each line contains two integers x,yx,y, Represents the abscissa and ordinate of one of the points .
The positions of the points do not coincide .
Output format
If there are points that meet the requirements , The output Yes
, Otherwise output No
.
Data range
The first three test points meet 2≤n≤102≤n≤10.
All test points meet 2≤n≤1002≤n≤100,|x|,|y|≤100|x|,|y|≤100,|x|≠0|x|≠0.
sample input 1:
3
1 1
-1 -1
2 -1
sample output 1:
Yes
sample input 2:
4
1 1
2 2
-1 1
-2 2
sample output 2:
No
sample input 3:
3
1 2
2 1
4 60
sample output 3:
Yes
The code is as follows :
#include<iostream>
#include<cstring>
using namespace std;
int n, cnt1, cnt2;
int main() {
ios::sync_with_stdio(false);
cout.tie(NULL);
cin >> n;
for(int i = 0; i < n; i ++) {
int x, y;
cin >> x >> y;
if(x > 0) cnt1++;
else cnt2++;
}
if(cnt1 == 1 || cnt2 == 1 || cnt1 == 0 || cnt2 == 0)
cout<<"Yes";
else
cout<<"No";
return 0;
}
边栏推荐
- ACL 2022 | 序列标注的小样本NER:融合标签语义的双塔BERT模型
- Improving Multimodal Accuracy Through Modality Pre-training and Attention
- Redis 持久化机制
- asp读取oracle数据库问题
- POJ 1094 sorting it all out
- 项目复盘模板
- Comparison between variable and "zero value"
- Let's see through the network i/o model from beginning to end
- Const keyword
- Cloud native technology container knowledge points
猜你喜欢
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
Les entreprises ne veulent pas remplacer un système vieux de dix ans
Mysql 身份认证绕过漏洞(CVE-2012-2122)
Let's see through the network i/o model from beginning to end
Improving Multimodal Accuracy Through Modality Pre-training and Attention
asp读取oracle数据库问题
MATLAB小技巧(27)灰色预测
Rust knowledge mind map XMIND
Machine test question 1
Dockermysql modifies the root account password and grants permissions
随机推荐
Dayu200 experience officer homepage AITO video & Canvas drawing dashboard (ETS)
2014阿里巴巴web前实习生项目分析(1)
How big is the empty structure?
Unified Focal loss: Generalising Dice and cross entropy-based losses to handle class imbalanced medi
Children's pajamas (Australia) as/nzs 1249:2014 handling process
Bipartite graph determination
CRMEB商城系统如何助力营销?
MySQL ---- first acquaintance with MySQL
Thinkphp5 multi table associative query method join queries two database tables, and the query results are spliced and returned
Balanced Multimodal Learning via On-the-fly Gradient Modulation(CVPR2022 oral)
Aardio - integrate variable values into a string of text through variable names
How to choose indoor LED display? These five considerations must be taken into account
DR-Net: dual-rotation network with feature map enhancement for medical image segmentation
Balanced Multimodal Learning via On-the-fly Gradient Modulation(CVPR2022 oral)
2014 Alibaba web pre intern project analysis (1)
three. JS gorgeous bubble effect
The ceiling of MySQL tutorial. Collect it and take your time
Flutter life cycle
Demonstration of the development case of DAPP system for money deposit and interest bearing financial management
Is "applet container technology" a gimmick or a new outlet?