21025_T-ShirtGumbo

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

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

Pro.ID

21025

Title

T-Shirt Gumbo

Title链接

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

AC

0

Submit

335

Ratio

0.00%

时间&空间限制

  • Time Limit: 1500/500 MS (Java/Others)     Memory Limit: 131072/65536 K (Java/Others)
  • 描述

    Boudreaux and Thibodeaux are student volunteers for this year's ACM South Central Region's programming contest. One of their duties is to distribute the contest T-shirts to arriving teams. The T-shirts had to be ordered in advance using an educated guess as to how many shirts of each size should be needed. Now it falls to Boudreaux and Thibodeaux to determine if they can hand out T-shirts to all the contestants in a way that makes everyone happy.

    输入

    Input to this problem will consist of a (non-empty) series of up to 100 data sets. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets. 

    A single data set has 4 components: 
    1. Start line - A single line: 
      START X 

      where (1 <= X <= 20) is the number of contestants demanding shirts. 
    2. Tolerance line - A single line containing X space-separated pairs of letters indicating the size tolerances of each contestant. Valid size letters are S - small, M - medium, L - large, X - extra large, T - extra extra large. Each letter pair will indicate the range of sizes that will satisfy a particular contestant. The pair will begin with the smallest size the contestant will accept and end with the largest. For example: 
      MX 

      would indicate a contestant that would accept a medium, large, or extra large T-shirt. If a contestant is very picky, both letters in the pair may be the same. 
    3. Inventory line - A single line: 
      S M L X T 

      indicating the number of each size shirt in Boudreaux and Thibodeaux's inventory. These values will be between 0 and 20 inclusive. 
    4. End line - A single line: 
      END 

    After the last data set, there will be a single line: 
    ENDOFINPUT

    输出

    Description
    Boudreaux and Thibodeaux are student volunteers for this year's ACM South Central Region's programming contest. One of their duties is to distribute the contest T-shirts to arriving teams. The T-shirts had to be ordered in advance using an educated guess as to how many shirts of each size should be needed. Now it falls to Boudreaux and Thibodeaux to determine if they can hand out T-shirts to all the contestants in a way that makes everyone happy.
    Input
    Input to this problem will consist of a (non-empty) series of up to 100 data sets. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets. 

    A single data set has 4 components: 
    1. Start line - A single line: 
      START X 

      where (1 <= X <= 20) is the number of contestants demanding shirts. 
    2. Tolerance line - A single line containing X space-separated pairs of letters indicating the size tolerances of each contestant. Valid size letters are S - small, M - medium, L - large, X - extra large, T - extra extra large. Each letter pair will indicate the range of sizes that will satisfy a particular contestant. The pair will begin with the smallest size the contestant will accept and end with the largest. For example: 
      MX 

      would indicate a contestant that would accept a medium, large, or extra large T-shirt. If a contestant is very picky, both letters in the pair may be the same. 
    3. Inventory line - A single line: 
      S M L X T 

      indicating the number of each size shirt in Boudreaux and Thibodeaux's inventory. These values will be between 0 and 20 inclusive. 
    4. End line - A single line: 
      END 

    After the last data set, there will be a single line: 
    ENDOFINPUT
    Output
    For each data set, there will be exactly one line of output. This line will reflect the attitude of the contestants after the T-shirts are distributed. If all the contestants were satisfied, output: 

    T-shirts rock! 

    Otherwise, output: 
    I'd rather not wear a shirt anyway...
    Sample Input
    START 1
    ST
    0 0 1 0 0
    END
    START 2
    SS TT
    0 0 1 0 0
    END
    START 4
    SM ML LX XT
    0 1 1 1 0
    END
    ENDOFINPUT
    Sample Output
    T-shirts rock!
    I'd rather not wear a shirt anyway...
    I'd rather not wear a shirt anyway...
    Source

    样例输入

    START 1
    ST
    0 0 1 0 0
    END
    START 2
    SS TT
    0 0 1 0 0
    END
    START 4
    SM ML LX XT
    0 1 1 1 0
    END
    ENDOFINPUT

    样例输出

    T-shirts rock!
    I'd rather not wear a shirt anyway...
    I'd rather not wear a shirt anyway...

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部