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

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;
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章