21727_OUTFITS

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

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

Pro.ID

21727

Title

OUTFITS

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    Becs and Cas are best friends. Cas left school when she was 16 as she has total fashion shopping skills, and became a manager at Supre. So, she and Becs get their clothes from Supre - and in fact they have always bought exactly what the other has (they are that shallow), but they would simply die if they wore the same thing on the same day.

    The two friends are so into copying each other that they have exactly the same outfits in their wardrobes hanging in exactly the same order. However, sometimes one of them just hates an outfit, so throws it out. (For the sake of friendship she doesn't tell the other and if she's ever asked about it by text she pretends it is at the cleaners).

    One difference between the girls is that Becs numbers her outfits from left to right, so outfit 1 is the leftmost outfit, whereas Cas numbers them from right to left, so 1 is the rightmost outfit. Their wardrobes look the same, though, so, for example, the leftmost outfit in each wardrobe is the same.
    Your task in this problem is to write a program that would alert Becs and Cas in advance if they choose the same outfit for a particular day.

    输入

    Input consists of a number of scenarios. Each scenario starts with two integers, n and d. n (5 < n <= 50) represents the number of outfits in each girl's wardrobe before any are thrown out. d represents the number of days to be considered. The last line of input is a scenario containing 0 0 ? this is not to be processed.

    The next 2 lines show outfits that have been removed from the girl's wardrobes. Each line will contain a single integer, r (0 <= r <= n). A value of 0 means no outfit has been removed. Any other value means the girl has removed that numbered outfit (according to her numbering system) from her wardrobe. The first line will refer to Becs' wardrobe, the second to Cas'.

    There then follow d lines, each representing the outfits chosen by each girl on a particular day, separated by a space with Becs' choice first. For example:

    3 12
    means that Becs chose outfit 3 counting from the left of her wardrobe, Cas chose outfit 12 counting from the right of her wardrobe.

    输出

    Description

    Becs and Cas are best friends. Cas left school when she was 16 as she has total fashion shopping skills, and became a manager at Supre. So, she and Becs get their clothes from Supre - and in fact they have always bought exactly what the other has (they are that shallow), but they would simply die if they wore the same thing on the same day.

    The two friends are so into copying each other that they have exactly the same outfits in their wardrobes hanging in exactly the same order. However, sometimes one of them just hates an outfit, so throws it out. (For the sake of friendship she doesn't tell the other and if she's ever asked about it by text she pretends it is at the cleaners).

    One difference between the girls is that Becs numbers her outfits from left to right, so outfit 1 is the leftmost outfit, whereas Cas numbers them from right to left, so 1 is the rightmost outfit. Their wardrobes look the same, though, so, for example, the leftmost outfit in each wardrobe is the same.
    Your task in this problem is to write a program that would alert Becs and Cas in advance if they choose the same outfit for a particular day.
    Input
    Input consists of a number of scenarios. Each scenario starts with two integers, n and d. n (5 < n <= 50) represents the number of outfits in each girl's wardrobe before any are thrown out. d represents the number of days to be considered. The last line of input is a scenario containing 0 0 ? this is not to be processed.

    The next 2 lines show outfits that have been removed from the girl's wardrobes. Each line will contain a single integer, r (0 <= r <= n). A value of 0 means no outfit has been removed. Any other value means the girl has removed that numbered outfit (according to her numbering system) from her wardrobe. The first line will refer to Becs' wardrobe, the second to Cas'.

    There then follow d lines, each representing the outfits chosen by each girl on a particular day, separated by a space with Becs' choice first. For example:

    3 12
    means that Becs chose outfit 3 counting from the left of her wardrobe, Cas chose outfit 12 counting from the right of her wardrobe.
    Output
    Output will be a scenario number, followed by one line for each day in that scenario. Each day will have a day number followed by OK if the girls have chosen different outfits, ALERT if they have chosen the same one.
    Sample Input
    20 4
    0
    0
    1 3
    6 15
    20 1
    10 10
    12 3
    7
    0
    7 5
    3 10
    7 6
    0 0
    Sample Output
    Scenario 1
    Day 1 OK
    Day 2 ALERT
    Day 3 ALERT
    Day 4 OK
    Scenario 2
    Day 1 ALERT
    Day 2 ALERT
    Day 3 OK
    Source

    样例输入

    20 4
    0
    0
    1 3
    6 15
    20 1
    10 10
    12 3
    7
    0
    7 5
    3 10
    7 6
    0 0

    样例输出

    Scenario 1
    Day 1 OK
    Day 2 ALERT
    Day 3 ALERT
    Day 4 OK
    Scenario 2
    Day 1 ALERT
    Day 2 ALERT
    Day 3 OK

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部