Codeforces 493D Vasya and Chess (game?) )

Source: Internet
Author: User

Portal: Click to open link


Main topic:

to a n*n board. Then the white team's Queen at the beginning (queen), the Black team's (1,n).

The rest of the points are green pieces.

The Queen can go both vertically and diagonally. (It's queen in chess, but it has to be eaten).

Ask White to go first. Who can win (die if you don't have to go or get eaten)


Problem Solving Ideas:

Game problem: Habitual random guess is over. Write faster than A.

Guess the method is as follows: Each step of each person, can make the total parity of the same. Then just know the parity of the first distance. I knew who was going to die first. (Do not spray)

#include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include < Cstring>using namespace Std;int Main () {    int n;    CIN >> N;    if (n&1)        printf ("black\n");    else        printf ("white\n1 2\n");    return 0;}


Codeforces 493D Vasya and Chess (game?) )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.