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

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