D. Vasya and Chess

这个题略搞笑,蒙的。。。

奇偶判断了下就过了。。。

 1 #include <iostream>
 2 #include <stdio.h>
 3 #include <algorithm>
 4 #include <cstring>
 5 #include <string.h>
 6 #include <math.h>
 7 #include <queue>
 8 #include <stack>
 9 #include <stdlib.h>
10 #include <map>
11 using namespace std;
12 #define LL long long
13 #define sf(a) scanf("%d",&(a));
14
15 #define N 100010
16
17 int main(){
18     int n;
19     scanf("%d",&n);
20     if(n%2==0) printf("white\n1 2\n");
21     else printf("black\n");
22
23
24     return 0;
25 }
时间: 2024-10-11 16:53:16

D. Vasya and Chess的相关文章

Codeforces Round #281 (Div. 2) D. Vasya and Chess 博弈

D. Vasya and Chess Vasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess. The queen is the piece that captures all squares on its vertical, horizontal and diagonal lines. If the cell is

CodeForces 493D Vasya and Chess 简单博弈

Vasya and Chess Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u CodeForces 493D Description Vasya decided to learn to play chess. Classic chess doesn't seem interesting to him, so he plays his own sort of chess. The quee

codeforces 493D Vasya and Chess(博弈?)

传送门:点击打开链接 题目大意: 给一个N*N的棋盘.然后一开始 白队的Queen在(1,1),黑队的Queen在(1,n). 其余的点都是绿棋子. Queen可以走横竖和斜线.(就是国际象棋里面Queen的走法,但是必须要吃子). 问白方先走.谁能嬴(没得走或者被吃了就死了) 解题思路: 博弈题..习惯性乱猜 就过了.写的比A还快. 猜法如下:每个人各走一步,可以使得总奇偶性不变.然后只要知道一开始的距离的奇偶性.就知道谁先死了.(勿喷) #include <cstdio> #include

codeforces 493 D Vasya and Chess【 博弈 】

题意:给出n*n的棋盘,白方在(1,1),黑方在(1,n)处,每一步可以上下左右对角线走,哪个先抓到另一个,则它获胜 可以画一下,发现n是奇数的时候,白方先走,无论它怎么走,黑方和它走对称的,黑方都一定能赢 n是偶数的时候,将白方走到(1,2)就变成奇数的情况,白方必胜 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include <cmath> 5 #include<st

周练1

最近一个多月为各种考试复习,感觉整个人学傻了..今天去集训队练习,虽然训练时长只有两个小时,但感觉好累哦.今晚冒个泡,然后继续滚去复习...啊啊啊每周都有考试,呜呜/(ㄒoㄒ)/~~ CodeForces 586D Phillip and Trains(bfs) 第一遍提交时忘记对选入队列的状态进行标记导致MLE(我真的傻了..) 其实这题还挺裸的.. #include<cstdio> #include<cstring> #include<algorithm> #inc

cf 493D

B - Vasya and Chess Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 493D Appoint description:  System Crawler  (2014-12-12) Description Vasya decided to learn to play chess. Classic ches

Codeforces Round #281 (Div. 2) 解题报告 A.B.C.D.

A - Vasya and Football 纯模拟..比较坑的是会有不符合足球常识的地方.. 代码如下: #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <stdlib.h> #include <math.h> #include <ctype.h> #include <queue> #inc

【Mutual Training for Wannafly Union #1 】

A.Phillip and Trains CodeForces 586D 题意:过隧道,每次人可以先向前一格,然后向上或向下或不动,然后车都向左2格.问能否到达隧道终点. 题解:dp,一开始s所在列如果前方为'.'则dp[i]=1.r[i]代表上一次的dp[i]值. 如果该行当前可行,那么它就可以更新它上下两行(如果有),必须用r[i]去更新. 再判断每行在当前时间是否会发生撞车:看看位置 i+t*2,i+t*2+1,i+t*2+2 是否有车. #include <iostream> #inc

codeforces 493 ABCD

A. Vasya and Football A. Vasya and Football time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Vasya has started watching football games. He has learned that for some fouls the players receiv