21191_TheGourmetClub

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

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

Pro.ID

21191

Title

The Gourmet Club

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    The gourmet club of ACM City has 16 members. They contracted the proprietor of the local French restaurant Chateau Java to arrange dinner parties for 5 consecutive evenings. They asked to be seated around 4 tables, 4 persons per table. They also stipulated that during the 5 evenings, every member of the club will share a table exactly once with each member of the club. Mr. I.B. Emm, the restaurateur, assigned his Maitre D' the task of scheduling the seating for the 5 evenings. On the first evening, the Maitre D' seated the members as they arrived and recorded their seating. Each subsequent evening, he carefully planned the seating to match the requirement that no member will be dining twice with some other member. Unfortunately, the Maitre D' disappeared on the morning of the fourth evening. Mr. Emm was left only with his notes which included the recorded seating arrangements during the previous 3 evenings. As he was trying to schedule the seating for the remaining evenings, it dawned on him that this task may not be that easy. He is asking for your help to try and see whether the remaining two evenings can be scheduled. The following is a sample of the Maitre D's seating arrangements during the first 3 evenings: 

    ABCD EFGH IJKL MNOP 
    AEIM BFJN CGKO DHLP 
    AFKP BGLM CHIN DEJO 

    The members of the gourmet club were identified by the letters A,B,C,...,P. 
    Each line represents one evening of seating with each set of four letters a single table. Thus on the first evening A dines with B, C and D etc. Write a program that will read from the input the seating arrangement of the first three evenings and will either complete the schedule or determine that the Maitre D' screwed up.

    输入

    Each data set will be 3 lines. Each line will consist of four blocks, each 4 letters long. All letters will be in upper case. Blocks will be separated by "white space". Data sets will be separated by blank lines.

    输出

    Description
    The gourmet club of ACM City has 16 members. They contracted the proprietor of the local French restaurant Chateau Java to arrange dinner parties for 5 consecutive evenings. They asked to be seated around 4 tables, 4 persons per table. They also stipulated that during the 5 evenings, every member of the club will share a table exactly once with each member of the club. Mr. I.B. Emm, the restaurateur, assigned his Maitre D' the task of scheduling the seating for the 5 evenings. On the first evening, the Maitre D' seated the members as they arrived and recorded their seating. Each subsequent evening, he carefully planned the seating to match the requirement that no member will be dining twice with some other member. Unfortunately, the Maitre D' disappeared on the morning of the fourth evening. Mr. Emm was left only with his notes which included the recorded seating arrangements during the previous 3 evenings. As he was trying to schedule the seating for the remaining evenings, it dawned on him that this task may not be that easy. He is asking for your help to try and see whether the remaining two evenings can be scheduled. The following is a sample of the Maitre D's seating arrangements during the first 3 evenings: 

    ABCD EFGH IJKL MNOP 
    AEIM BFJN CGKO DHLP 
    AFKP BGLM CHIN DEJO 

    The members of the gourmet club were identified by the letters A,B,C,...,P. 
    Each line represents one evening of seating with each set of four letters a single table. Thus on the first evening A dines with B, C and D etc. Write a program that will read from the input the seating arrangement of the first three evenings and will either complete the schedule or determine that the Maitre D' screwed up.
    Input
    Each data set will be 3 lines. Each line will consist of four blocks, each 4 letters long. All letters will be in upper case. Blocks will be separated by "white space". Data sets will be separated by blank lines.
    Output
    For a successful schedule, echo the input and add two lines showing the successful schedule. If it is not possible to complete the schedule, do not echo the input, but print "It is not possible to complete this schedule." Separate output for each data set with a blank line.
    Sample Input
    ABCD EFGH IJKL MNOP
    AEIM BFJN CGKO DHLP
    AFKP BGLM CHIN DEJO
    Sample Output
    It is not possible to complete this schedule.
    Hint

    If there are several solutions ,any one is ok. 

    Special Judge

    Source

    样例输入

    ABCD EFGH IJKL MNOP
    AEIM BFJN CGKO DHLP
    AFKP BGLM CHIN DEJO

    样例输出

    It is not possible to complete this schedule.

    提示

    If there are several solutions ,any one is ok. 

    Special Judge


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部