We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a3b648 commit 5cf89a0Copy full SHA for 5cf89a0
900A - Find Extra One.cpp
@@ -0,0 +1,35 @@
1
+#include<bits/stdc++.h>
2
+using namespace std;
3
+
4
+// Code Written By: Vikash Patel
5
6
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
7
8
+int main()
9
+{
10
+ int n;
11
+ cin>>n;
12
+ int x[n],y[n];
13
+ int leftcord=0;
14
+ int rightcord=0;
15
+ for(int i=0;i<n;i++)
16
+ {
17
+ cin>>x[i]>>y[i];
18
+ if(x[i]<0)
19
20
+ leftcord++;
21
+ }
22
+ else
23
24
+ rightcord++;
25
26
27
+ if(leftcord==1 || rightcord==1 || (leftcord==0 && rightcord>0) || (leftcord>0 && rightcord==0))
28
29
+ cout<<"YES"<<endl;
30
31
32
33
+ cout<<"NO"<<endl;
34
35
+}
0 commit comments