码迷,mamicode.com
首页 > 其他好文 > 详细

HackerRank "Kitty and Katty"

时间:2016-04-15 13:36:19      阅读:113      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!