- 题解
风神瞳
- @ 2023-8-8 8:37:54
#include #include<stdio.h> #include<math.h> #include #include #include #include #include using namespace std; bool cmp(int a,int b){ return a > b; } int main(){ int a,x,y,x1,y1 = 0; cin >> a >> x >> y >> x1 >> y1; if(a == 1){ if(x == x1 or y == y1){ cout << "Yes"; }else{ cout << "No"; } }else if(a == 2){ cout << "No"; }else if(a == 3){ if((x1 == x+2 and y1 == y+1)or(x1 == x+2 and y1 == y-1)or(x1 == x-2 and y1 == y+1)or(x1 == x-2 and y1 == y-1)or(x1 == x+1 and y1 == y+2)or(x1 == x+1 and y1 == y-2)or(x1 == x-1 and y1 == y+2)or(x1 == x-1 and y1 == y-2)){ cout << "Yes"; }else{ cout << "No"; } }else if(a == 4){ if((x1 == x+2 and y1 == y+2)or(x1 == x+2 and y1 == y-2)or(x == x-2 and y1 == y+2)or(x1 == x-2 and y1 == y-2)){ cout << "Yes"; }else{ cout << "No"; } } }