EOJ Monthly 2019.3 (based on March Selection) D. 宇恒棋

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/L1558198727/article/details/88804014

https://acm.ecnu.edu.cn/problem/3682/

想把对手逼到角落才能赢,但是又不能靠太近,谁先到达根号距离2的位置谁就赢了
判断横纵坐标差值的和的奇偶性即可

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int main()
{
    int n,m;
    int x1,y1,x2,y2;
    scanf("%d%d",&n,&m);
    scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
    int ret = 0;
    ret+= abs(x1-x2);
    ret+= abs(y1-y2);
    if(ret%2==0){
        cout<<"Win"<<endl;
    }else{
        cout<<"Lose"<<endl;
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/L1558198727/article/details/88804014