首页 > 其他 > 详细

HackerRank "Kitty and Katty"

时间:2016-04-15 13:34:44      阅读:207      评论:0      收藏:0      [点我收藏+]

It‘s more of a brain-teaser than a Game Theory problem..

#!/bin/python3

T = int(input().strip())
for a0 in range(T):
    n = int(input().strip())
    #
    #   The last left 2 blocks can always produce a winning state, given % 3:
    #   Think about the below cases
    #   equal: 0-0 1-1 2-1
    #   non-equal: 0-1, 1-2, 0-2
    if n == 1: 
        print ("Kitty")
    elif n & 1:
        print ("Katty")
    else:
        print ("Kitty")

 

HackerRank "Kitty and Katty"

原文:http://www.cnblogs.com/tonix/p/5394853.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!