HDU 1517: kiki's game

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HDU 1517: kiki's game相关的知识,希望对你有一定的参考价值。


/**
* @link http://acm.hdu.edu.cn/showproblem.php?pid=1517
* @author Sycamore
* @date Aug, 21
*/
// Suppose that their exists a direction(vertically or horizontally) in which
// the steps remaining to arrive at the destination (n-1 or m-1) is even, as long
// as Kiki adjusts the position of the chess to the following parity at first, he
// always has the priority of keeping the parity in both directions unchanged (even)
// every time it‘s ZZ‘s turn until the chess reaches the terminal and ZZ is trapped.
// On the opposite occasion, ZZ will have that priority so that Kiki will lost
// the game.
import java.util.*;

class Main{

public static void main(String args[]){
Scanner scanner=new Scanner(System.in);
while(scanner.hasNextInt()){
int n=scanner.nextInt(),m=scanner.nextInt();
if(n==0&&m==0)break;
System.out.println(((n&1)==0||(m&1)==0)?"Wonderful!":"What a pity!");
}

scanner.close();
}
}

 

以上是关于HDU 1517: kiki's game的主要内容,如果未能解决你的问题,请参考以下文章

HDU - 2147 kiki's game

HDU 2147 kiki's game

hdu2174 kiki's game 博弈

hdu 2147 kiki's game(找规律)

HDU 2147 kiki's game(规律,博弈)

HDU 1564 Play a game && HDU 2147 kiki's game