Codeforces 493 D Vasya and Chess "game"

Source: Internet
Author: User

Test instructions: Give N*n chess board, White in (first), Black in (1,n), each step can go up and down diagonally, which first caught another, then it won

Can draw, found that N is an odd time, white first go, no matter how it goes, black and it go symmetrical, black side will be able to win

When n is an even number, the white side will go to an odd number of cases, white win

1#include <iostream>2#include <cstdio>3#include <cstring>4#include <cmath>5#include <stack>6#include <vector>7#include <map>8#include <Set>9#include <queue>Ten#include <algorithm> One using namespacestd; A  -typedefLong LongLL; - Const intINF = (1<< -)-1; the Const intMod=1000000007; - Const intmaxn=1000005; -  - intMain () { +     intN; -scanf"%d",&n); +     if(n&1) puts ("Black"); A     Elseprintf"white\n1 2\n"); at     return 0; -}
View Code

Codeforces 493 D 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.