Skip to content

Commit e43f93a

Browse files
committed
Create 2004A-ClosestPoint.cpp
1 parent 557e024 commit e43f93a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

2004A-ClosestPoint.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <cstdio>
2+
3+
int main(){
4+
5+
long t; scanf("%ld", &t);
6+
while(t--){
7+
long n; scanf("%ld", &n);
8+
long a, b;
9+
for(long p = 0; p < n; p++){b = a; scanf("%ld", &a);}
10+
puts( (n == 2 && (b - a > 1 || b - a < -1)) ? "YES" : "NO");
11+
}
12+
13+
}

0 commit comments

Comments
 (0)