21969_Friends

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

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

Pro.ID

21969

Title

Friends

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 3000/1000 MS (Java/Others)     Memory Limit: 65536/32768 K (Java/Others)
  • 描述

    You know this problem... several friends meet at the Hacienda (a rather fine restaurant) every Wednesday,have some drinks and fun in general until someone brings up the dreaded question: "So, where are we going tonight?" 
    At this point basically two things can happen: Either take the Swedish solution or the Italian solution. The Swedish solution means that there is an absolutely embarrassing silence for about five minutes disturbed only once or twice by a muttered "Uh, I don't care...", then they finally agree (silently of course) to get totally drunk. The Italian solution includes (but is not limited to) lots of shouting, total mayhem in the Hacienda, and probably 'family' problems. 
    But wait, yes - you are right. We are in Germany, so our friends will take the German solution, of course.That means: Voting! 

    As you can imagine, the friends do not just vote for a certain place to go to depending on their current mood.It really depends much more on who is there on a given Wednesday. Here are the rules: 
    1. Anne will always vote for going to the cinema. 
    2. Bob will vote for going to the disco if Karin is there, too. 
    3. Karin will vote for going to the disco if Charly is there, if Charly is not there but Anne is, Karin will vote for going to the cinema, if Charly and Anne are not there Karin will vote for going to the cocktail bar. 
    4. Dave is one of those guys who never votes for anything. 
    5. If Dave is there, Bob will vote for going to the cocktail bar. 
    6. If Charly and Anne are there, both of them will vote for going to the cinema. 
    7. Edward votes for going to the cocktail bar if Anne is there and Charly is not there, otherwise Edward votes for going to the cinema. 
    8. If Edward is there, Bob will vote for going to the cocktail bar. 
    9. Frank will vote for going to the cinema if neither Bob nor Anne are there, and Frank will vote for going to the disco if Anne is there. 
    10. If Anne is not there, Bob will vote for going to the cocktail bar. 
    For a given Wednesday, count the votes for each place from the friends who are there on that Wednesday.If no rule applies for a present friend or if several rules apply and require the friend to vote for different places, this friend abstains from voting on that Wednesday.

    输入

    The first line contains the number of scenarios (Wednesday meetings). 
    For each scenario, there is one line containing the names of the present friends. Names are separated by single blanks and consist of letters only. The same name will not occur more than once on the same line.

    输出

    Description
    You know this problem... several friends meet at the Hacienda (a rather fine restaurant) every Wednesday,have some drinks and fun in general until someone brings up the dreaded question: "So, where are we going tonight?" 
    At this point basically two things can happen: Either take the Swedish solution or the Italian solution. The Swedish solution means that there is an absolutely embarrassing silence for about five minutes disturbed only once or twice by a muttered "Uh, I don't care...", then they finally agree (silently of course) to get totally drunk. The Italian solution includes (but is not limited to) lots of shouting, total mayhem in the Hacienda, and probably 'family' problems. 
    But wait, yes - you are right. We are in Germany, so our friends will take the German solution, of course.That means: Voting! 

    As you can imagine, the friends do not just vote for a certain place to go to depending on their current mood.It really depends much more on who is there on a given Wednesday. Here are the rules: 
    1. Anne will always vote for going to the cinema. 
    2. Bob will vote for going to the disco if Karin is there, too. 
    3. Karin will vote for going to the disco if Charly is there, if Charly is not there but Anne is, Karin will vote for going to the cinema, if Charly and Anne are not there Karin will vote for going to the cocktail bar. 
    4. Dave is one of those guys who never votes for anything. 
    5. If Dave is there, Bob will vote for going to the cocktail bar. 
    6. If Charly and Anne are there, both of them will vote for going to the cinema. 
    7. Edward votes for going to the cocktail bar if Anne is there and Charly is not there, otherwise Edward votes for going to the cinema. 
    8. If Edward is there, Bob will vote for going to the cocktail bar. 
    9. Frank will vote for going to the cinema if neither Bob nor Anne are there, and Frank will vote for going to the disco if Anne is there. 
    10. If Anne is not there, Bob will vote for going to the cocktail bar. 
    For a given Wednesday, count the votes for each place from the friends who are there on that Wednesday.If no rule applies for a present friend or if several rules apply and require the friend to vote for different places, this friend abstains from voting on that Wednesday.
    Input
    The first line contains the number of scenarios (Wednesday meetings). 
    For each scenario, there is one line containing the names of the present friends. Names are separated by single blanks and consist of letters only. The same name will not occur more than once on the same line.
    Output
    The output for every scenario begins with a line containing "Scenario #i:", where i is the number of the scenario starting at 1. 
    Then for each scenario print a single line containing the place that received the most votes. Possible places are 'cinema', 'cocktail bar', and 'disco'. If none of those places receives more votes than the other two print 'stay at the Hacienda'. 
    Terminate the output for the scenario with a blank line.
    Sample Input
    2
    Frank Dave
    Karin Frank
    Sample Output
    Scenario #1:
    cinema
    
    Scenario #2:
    stay at the Hacienda
    Source

    样例输入

    2
    Frank Dave
    Karin Frank

    样例输出

    Scenario #1:
    cinema
    
    Scenario #2:
    stay at the Hacienda

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部