CF63E.Sweets Game

普及+/提高

通过率:0%

时间限制:3.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Karlsson has visited Lillebror again. They found a box of chocolates and a big whipped cream cake at Lillebror's place. Karlsson immediately suggested to divide the sweets fairly between Lillebror and himself. Specifically, to play together a game he has just invented with the chocolates. The winner will get the cake as a reward.

The box of chocolates has the form of a hexagon. It contains 19 cells for the chocolates, some of which contain a chocolate. The players move in turns. During one move it is allowed to eat one or several chocolates that lay in the neighboring cells on one line, parallel to one of the box's sides. The picture below shows the examples of allowed moves and of an unacceptable one. The player who cannot make a move loses.

Karlsson makes the first move as he is Lillebror's guest and not vice versa. The players play optimally. Determine who will get the cake.

卡尔松再次拜访了小弟弟。他们在小弟弟家发现了一盒巧克力和一大块奶油蛋糕。卡尔松立刻提议将这些甜点公平地分给小弟弟和他自己,具体方法是:一起玩一个他刚刚发明的、以巧克力为道具的游戏。获胜者将获得蛋糕作为奖励。

这盒巧克力呈六边形,共包含 19 个放置巧克力的格子,其中部分格子中放有巧克力。两名玩家轮流进行操作。每次操作时,允许吃掉位于同一条直线(该直线平行于盒子的某一条边)上的一个或多个相邻格子中的巧克力。下图展示了合法操作与非法操作的示例。无法进行操作的玩家判负。

由于卡尔松是小弟弟的客人,因此由卡尔松先行操作(而非小弟弟先手)。双方均采取最优策略。请判断谁将赢得蛋糕。

输入格式

The input data contains 5 lines, containing 19 words consisting of one symbol. The word "O" means that the cell contains a chocolate and a "." stands for an empty cell. It is guaranteed that the box contains at least one chocolate. See the examples for better understanding.

输入数据包含 5 行,共 19 个单词,每个单词由一个字符组成。“O” 表示该格子中有一块巧克力,“.” 表示该格子为空。保证盒子中至少有一块巧克力。参见示例以更好地理解。

输出格式

If Karlsson gets the cake, print "Karlsson" (without the quotes), otherwise print "Lillebror" (yet again without the quotes).

如果卡尔松得到了蛋糕,输出 “Karlsson”(不带引号),否则输出 “Lillebror”(同样不带引号)。

输入输出样例

  • 输入#1

    . . .
     . . O .
    . . O O .
     . . . .
      . . .

    输出#1

    Lillebror
  • 输入#2

    . . .
     . . . O
    . . . O .
     O . O .
      . O .

    输出#2

    Karlsson

输入解题思路,AI测评打分。不知道怎么写?

首页