【链接】 我是链接,点我呀:)

【题意】

【题解】

会发现两个皇后之间如果只有奇数个位置
也就是n%2==1
那么第二个人总是赢的
因为如果white往下跑的话,black也能往下跑。
第二个人没有输的机会。
其他情况就是第一个人赢了...

【代码】

import java.io.*;
import java.util.*; public class Main { static InputReader in;
static PrintWriter out; public static void main(String[] args) throws IOException{
//InputStream ins = new FileInputStream("E:\\rush.txt");
InputStream ins = System.in;
in = new InputReader(ins);
out = new PrintWriter(System.out);
//code start from here
new Task().solve(in, out);
out.close();
} static int N = 50000;
static class Task{ int n; public void solve(InputReader in,PrintWriter out) {
n = in.nextInt();
if ( n%2==0) {
out.println("white\n1 2");
}else {
out.println("black");
}
}
} static class InputReader{
public BufferedReader br;
public StringTokenizer tokenizer; public InputReader(InputStream ins) {
br = new BufferedReader(new InputStreamReader(ins));
tokenizer = null;
} public String next(){
while (tokenizer==null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(br.readLine());
}catch(IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
} public int nextInt() {
return Integer.parseInt(next());
}
}
}

最新文章

  1. EQueue 2.0 性能测试报告
  2. Fiddler抓包工具使用基础
  3. 各种字符串Hash函数比较(转)
  4. 用JavaScript探测页面上的广告是否被AdBlock屏蔽了的方法
  5. [Flux] 3. Actions
  6. bootstrap-js(六)弹出框
  7. 利用WinDbg找出程序崩溃的代码行号
  8. js常用语句写法
  9. laravel5 数据库连接问题
  10. python时间模块小结
  11. 【STM32】临界区进入退出宏 OS_ENTER_CRITICAL() 和 OS_EXIT_CRITICAL()
  12. JSON数组形式字符串转换为List<Map<String,String>>的几种方法
  13. exe4j使用说明
  14. java基础---->使用Itext生成数据库文档
  15. 原生js的博客
  16. linux Composer 安装
  17. vue-route 路由传参的使用
  18. 关闭文件流--fclose,
  19. 转:The Great DOM Fuzz-off of 2017
  20. Java 之设计模式(总述)

热门文章

  1. bzoj 1426: 收集邮票【期望dp】
  2. bzoj 1611: [Usaco2008 Feb]Meteor Shower流星雨【BFS】
  3. bzoj 2015: [Usaco2010 Feb]Chocolate Giving【spfa】
  4. 牛客OI周赛2-提高组
  5. [C++ STL] vector使用详解
  6. 数学 FZU 2074 Number of methods
  7. 371 Sum of Two Integers 两整数之和
  8. WCF wsdlexception(at/html):faultCode=INVALID_WSDL
  9. python之路 之一pyspark
  10. jQuery学习笔记(3)-操作jQuery包装集的函数