CF1375F.Integer Game

省选/NOI-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

This is an interactive problem.

Anton and Harris are playing a game to decide which of them is the king of problemsetting.

There are three piles of stones, initially containing aa, bb, and cc stones, where aa, bb, and cc are distinct positive integers. On each turn of the game, the following sequence of events takes place:

  • The first player chooses a positive integer yy and provides it to the second player.
  • The second player adds yy stones to one of the piles, with the condition that he cannot choose the same pile in two consecutive turns.

The second player loses if, at any point, two of the piles contain the same number of stones. The first player loses if 10001000 turns have passed without the second player losing.

Feeling confident in his skills, Anton decided to let Harris choose whether he wants to go first or second. Help Harris defeat Anton and become the king of problemsetting!

这是一个交互式问题。

安东(Anton)和哈里斯(Harris)正在进行一场比赛,以决定谁将成为出题之王。

初始时有三堆石子,分别包含 aa、bb 和 cc 颗石子,其中 aa、bb、cc 是互不相等的正整数。游戏每轮按如下顺序进行:

  • 先手玩家选择一个正整数 yy,并将该数告知后手玩家;
  • 后手玩家将 yy 颗石子加入其中一堆石子中,但有一个限制:他不能在连续两轮中选择同一堆石子。

若在任意时刻有两堆石子数量相等,则后手玩家输;若在未出现上述情况的前提下已进行 10001000 轮,则先手玩家输。

安东对自己的实力充满信心,因此允许哈里斯自行选择执先手还是后手。请帮助哈里斯击败安东,成为出题之王!

输入格式

The first line of input contains three distinct positive integers aa, bb, and cc (1≤a,b,c≤1091 \le a, b, c \le 10^9) — the initial number of stones in piles 11, 22, and 33 respectively.

输入的第一行包含三个互不相同的正整数 aa、bb 和 cc(1≤a,b,c≤1091 \le a, b, c \le 10^9),分别表示第 11、22、33 堆石子的初始数量。

输入输出样例

  • 输入#1

    5 2 6
    
    
    3
    
    0

    输出#1

    First
    2
    
    3

说明/提示

In the sample input, the piles initially have 55, 22, and 66 stones. Harris decides to go first and provides the number 22 to Anton. Anton adds 22 stones to the third pile, which results in 55, 22, and 88.

In the next turn, Harris chooses 33. Note that Anton cannot add the stones to the third pile since he chose the third pile in the previous turn. Anton realizes that he has no valid moves left and reluctantly recognizes Harris as the king.

在样例输入中,三堆石子的初始数量分别为 55、22 和 66。哈里斯决定先手,并向安东提供数字 22。安东将 22 颗石子加入第三堆,使得三堆石子数量变为 55、22 和 88。

在下一轮中,哈里斯选择数字 33。注意:安东不能将石子加入第三堆,因为他上一轮已选择了第三堆。安东意识到自己已无合法操作可执行,只得不情愿地承认哈里斯为国王。

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

首页