10291_Roll-callinWoopWoopHig

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

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

Pro.ID

10291

Title

Roll-call in Woop Woop High

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    The new principal of Woop Woop High is not satisfied with her pupils performance. She introduced a new roll-call process to get a daily measure of the pupils' learning, which proceeds as follows:

    At the beginning of the daily roll-call period each pupil is handed a question, which they must attempt to answer, before proceeding to their classes. A pupil stops after the question is answered correctly. Each pupil is allowed up to five attempts to answer the question correctly.

    Pupils who answer correctly on the first attempt are marked present. Pupils who answer correctly after more than one attempt are encouraged to work at home. Pupils who fail to develop a correct answer within five attempts are given remedial classes after school. Pupils who do not give any answer are marked as abscent.

    Your task is to write a program that reads the pupils' assessments and generates performance reports for the principal to proceed with appropriate actions.

    输入

    The input starts with an integer K (1 ≤ K 100) indicating the number of classes. Each class starts with an integer N (1 N 50) indicating the number of pupils in the class. Each of the following N lines starts with a pupil's name followed by up-to five assessments of his/her answers. An assessment of 'yes' or 'y' indicates a correct answer and an assessment of 'n' or 'no' indicates a wrong answer. A pupil's name consists of a single string with no white spaces.

    输出

    Description

    The new principal of Woop Woop High is not satisfied with her pupils performance. She introduced a new roll-call process to get a daily measure of the pupils' learning, which proceeds as follows:

    At the beginning of the daily roll-call period each pupil is handed a question, which they must attempt to answer, before proceeding to their classes. A pupil stops after the question is answered correctly. Each pupil is allowed up to five attempts to answer the question correctly.

    Pupils who answer correctly on the first attempt are marked present. Pupils who answer correctly after more than one attempt are encouraged to work at home. Pupils who fail to develop a correct answer within five attempts are given remedial classes after school. Pupils who do not give any answer are marked as abscent.

    Your task is to write a program that reads the pupils' assessments and generates performance reports for the principal to proceed with appropriate actions.

    Input

    The input starts with an integer K (1 ≤ K 100) indicating the number of classes. Each class starts with an integer N (1 N 50) indicating the number of pupils in the class. Each of the following N lines starts with a pupil's name followed by up-to five assessments of his/her answers. An assessment of 'yes' or 'y' indicates a correct answer and an assessment of 'n' or 'no' indicates a wrong answer. A pupil's name consists of a single string with no white spaces.

    Output

    The attendance report for each class consists of five lines.

    • The first line consists of the sentence: "Roll-call: X", where X indicates the class number starting with the value of one.

    • The second line consists of the sentence: ''Present: Y1 out of N'', where Y1 is the number of pupils who did not submit a wrong answer.

    • The third line consists of the sentence: ''Needs to study at home: Y2 out of N'', where Y2 is the number of pupils who submitted a number of wrong answers before submitting the correct answer.

    • The fourth line consists of the sentence: ''Needs remedial work after school: Y3 out of N'', where Y3 indicates the number of pupils whose submitted five wrong answers.

    • The fifth line consists of the sentence: ''Absent: Y4 out of N'', where Y4 indicates the number of absent pupils.

    Sample Input

    2
    5 Doc n
    y
    sneezy n n no yes
    princecharming no n no no n
    goofy yes
    grumpy n y
    5 evilemperor n
    y
    princesslia
    r2d2 no no y
    obeyonecanopy n no y
    darthvedar y

    Sample Output

    Roll-call: 1
    Present: 1 out of 5
    Needs to study at home: 3 out of 5
    Needs remedial work after school: 1 out of 5
    Absent: 0 out of 5
    Roll-call: 2
    Present: 1 out of 5
    Needs to study at home: 3 out of 5
    Needs remedial work after school: 0 out of 5
    Absent: 1 out of 5

    Source

    样例输入

    2
    5 Doc n
    y
    sneezy n n no yes
    princecharming no n no no n
    goofy yes
    grumpy n y
    5 evilemperor n
    y
    princesslia
    r2d2 no no y
    obeyonecanopy n no y
    darthvedar y

    样例输出

    Roll-call: 1
    Present: 1 out of 5
    Needs to study at home: 3 out of 5
    Needs remedial work after school: 1 out of 5
    Absent: 0 out of 5
    Roll-call: 2
    Present: 1 out of 5
    Needs to study at home: 3 out of 5
    Needs remedial work after school: 0 out of 5
    Absent: 1 out of 5

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部