10280_MythBusters

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

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

Pro.ID

10280

Title

Myth Busters

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 10000/5000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Every train carriage operated by CityRail of Sydney has a unique ID number of four digits. A not so uncommon myth amongst local school pupils is that every ID number can be manipulated by permuting the digits, using brackets and using arithmetic operations from the set {'*' , '/', '+' , '-'} to calculate the number 10.

    Your task is to check the validity of this myth for the carriages operated by CityRail of Sydney and for train carriages from other cities whose ID numbers were collected.

    Reminder: The operation '/' refers to integer division. Most of you already know it, but here are two examples: result of 5/2 is 2 and of 2/5 is 0.

    输入

    The input consists of many test cases. The description of each test case consists of:

    • an integer N (1 ≤ N 1000), on a line by itself, which indicates the number of IDs collected from one city, and

    • N lines that contain a four-digit number each.

    A zero on a line by itself indicates the end of input and should not be processed.

    输出

    Description

    Every train carriage operated by CityRail of Sydney has a unique ID number of four digits. A not so uncommon myth amongst local school pupils is that every ID number can be manipulated by permuting the digits, using brackets and using arithmetic operations from the set {'*' , '/', '+' , '-'} to calculate the number 10.

    Your task is to check the validity of this myth for the carriages operated by CityRail of Sydney and for train carriages from other cities whose ID numbers were collected.

    Reminder: The operation '/' refers to integer division. Most of you already know it, but here are two examples: result of 5/2 is 2 and of 2/5 is 0.

    Input

    The input consists of many test cases. The description of each test case consists of:

    • an integer N (1 ≤ N 1000), on a line by itself, which indicates the number of IDs collected from one city, and

    • N lines that contain a four-digit number each.

    A zero on a line by itself indicates the end of input and should not be processed.

    Output

    For each test case print the conclusion of your investigation as TRUE or BUSTED as shown in "Output for the Sample Input" below. Print TRUE if this myth is correct for all carriage ID numbers for that city. Otherwise, BUSTED is to be printed.

    Sample Input

    2
    6666
    5555
    2
    1234
    1611
    1602
    0

    Sample Output

    BUSTED
    TRUE

    Source

    样例输入

    2
    6666
    5555
    2
    1234
    1611
    1602
    0

    样例输出

    BUSTED
    TRUE

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部