10278_MakingDecisions

2022-5-16 18:16| 发布者: Hocassian| 查看: 49| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504723840800-Problem List-采集的数据-后羿采集器.html

Pro.ID

10278

Title

Making Decisions

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10278

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 4000/2000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    In the olden days making decisions was easy. One would get a daisy and start to pluck its petals alternating between Do-it and Do-it-Not until the last petal was reached and a decision was made.

    Gadget-man wants to use a computerised version. The idea is to work with a random string of zeros and ones. He will pick up two bits, one from each end of the string, and compare them. If they are the same (that is, both ones or both zeros), then it is Do-it. If they differ, then it is Do-it-Not. The two bits are then discarded and the process is repeated on the remaining string until all the bits are picked. The last two bits to be picked will be the decision maker. By the way, the string may be random but it always contains an even number of bits that is greater than zero.

    Your task is to write a program that reads a string of zeros and ones and makes the decision for Gadget-man.

    输入

    The input starts with an integer N, on a line by itself, that represents the number of test cases. 1 N ≤ 1000. The description for each test case consists of a string of zeros and ones. There are no blank spaces separating the bits.

    输出

    Description

    In the olden days making decisions was easy. One would get a daisy and start to pluck its petals alternating between Do-it and Do-it-Not until the last petal was reached and a decision was made.

    Gadget-man wants to use a computerised version. The idea is to work with a random string of zeros and ones. He will pick up two bits, one from each end of the string, and compare them. If they are the same (that is, both ones or both zeros), then it is Do-it. If they differ, then it is Do-it-Not. The two bits are then discarded and the process is repeated on the remaining string until all the bits are picked. The last two bits to be picked will be the decision maker. By the way, the string may be random but it always contains an even number of bits that is greater than zero.

    Your task is to write a program that reads a string of zeros and ones and makes the decision for Gadget-man.

    Input

    The input starts with an integer N, on a line by itself, that represents the number of test cases. 1 N ≤ 1000. The description for each test case consists of a string of zeros and ones. There are no blank spaces separating the bits.

    Output

    The output consists of a single line, for each test case, which contains a string Do-it or a string Do-it-Not.

    Sample Input

    3
    00100010
    01010101
    100001

    Sample Output

    Do-it
    Do-it-Not
    Do-it

    Source

    样例输入

    3
    00100010
    01010101
    100001

    样例输出

    Do-it
    Do-it-Not
    Do-it

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部