当前位置:网站首页>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;
}
边栏推荐
- mysql查看表结构的三种方法总结
- How to choose the server system
- Aardio - does not declare the method of directly passing float values
- memcached
- The problem that dockermysql cannot be accessed by the host machine is solved
- uniapp滑动到一定的高度后固定某个元素到顶部效果demo(整理)
- 视图(view)
- [launched in the whole network] redis series 3: high availability of master-slave architecture
- Thinkphp5 multi table associative query method join queries two database tables, and the query results are spliced and returned
- rust知识思维导图xmind
猜你喜欢
金融人士必读书籍系列之六:权益投资(基于cfa考试内容大纲和框架)
Method of canceling automatic watermarking of uploaded pictures by CSDN
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
European Bioinformatics Institute 2021 highlights report released: nearly 1million proteins have been predicted by alphafold
asp读取oracle数据库问题
Financial professionals must read book series 6: equity investment (based on the outline and framework of the CFA exam)
Unified Focal loss: Generalising Dice and cross entropy-based losses to handle class imbalanced medi
让我们,从头到尾,通透网络I/O模型
(flutter2) as import old project error: inheritfromwidgetofexacttype
[launched in the whole network] redis series 3: high availability of master-slave architecture
随机推荐
On the problems of born charge and non analytical correction in phonon and heat transport calculations
Case recommendation: An Qing works with partners to ensure that the "smart court" is more efficient
Extern keyword
[IELTS speaking] Anna's oral learning record part1
uniapp设置背景图效果demo(整理)
Balanced Multimodal Learning via On-the-fly Gradient Modulation(CVPR2022 oral)
服务器的系统怎么选者
Introduction to network basics
Thinkphp5 multi table associative query method join queries two database tables, and the query results are spliced and returned
The ceiling of MySQL tutorial. Collect it and take your time
Enterprises do not want to replace the old system that has been used for ten years
允许全表扫描 那个语句好像不生效set odps.sql.allow.fullscan=true;我
Let's see through the network i/o model from beginning to end
UE4 blueprint learning chapter (IV) -- process control forloop and whileloop
memcached
How to choose the server system
[leetcode] 19. Delete the penultimate node of the linked list
UVa 11732 – strcmp() Anyone?
cuda 探索
Cocoscreator+typescripts write an object pool by themselves