21278_Ropes

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

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

Pro.ID

21278

Title

Ropes

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    When climbing a section or “pitch”, the lead climber ascends first, taking a rope with them that they anchor to the rock for protection to ascend. Once at the top of a pitch, the lead climber has the second climber attach to the rope, so they can ascend with the safety of the rope. Once the second climber reaches the top of the pitch, the third attaches, and so on until all the climbers have ascended.

    For example, for a 10 meter pitch and 50 meter rope, at most 6 climbers could ascend, with the last climber attaching to the end of the rope. To ascend safely, there must be at least 2 climbers and the rope must be at least as long as the pitch.

    This process is repeated on each pitch of the climb, until the top is reached. Then to descend, the climbing rope is hung at its midpoint from an anchor (each half must reach the ground). The climbers then each rappel from this rope. The rope is retrieved from the anchor by pulling one side of the rope, slipping it though the anchor and allowing it to fall to the ground.

    To descend safely, the rope must be at least twice as long as the sum of the lengths of the pitches.

    For example, a 60 meter rope is required to rappel from a 30 meter climb, no matter how many climbers are involved.

    Climbing ropes come in 50, 60 and 70 meter lengths. It is best to take the shortest rope needed for a given climb because this saves weight. You are to determine the maximum number of climbers that can use each type of rope on a given climb.

    输入

    The input consists of a number of cases. Each case specifies a climb on a line, as a sequence of pitch lengths as in:

    N P1 P2 ... PN

    Here N is the positive number of pitches, with 1 ≤ N ≤ 100, and Pk is the positive integer length (in meters) of each pitch, with 1 ≤ Pk ≤ 100. The last line (indicating the end of input) is a single 0.

    输出

    Description

    When climbing a section or “pitch”, the lead climber ascends first, taking a rope with them that they anchor to the rock for protection to ascend. Once at the top of a pitch, the lead climber has the second climber attach to the rope, so they can ascend with the safety of the rope. Once the second climber reaches the top of the pitch, the third attaches, and so on until all the climbers have ascended.

    For example, for a 10 meter pitch and 50 meter rope, at most 6 climbers could ascend, with the last climber attaching to the end of the rope. To ascend safely, there must be at least 2 climbers and the rope must be at least as long as the pitch.

    This process is repeated on each pitch of the climb, until the top is reached. Then to descend, the climbing rope is hung at its midpoint from an anchor (each half must reach the ground). The climbers then each rappel from this rope. The rope is retrieved from the anchor by pulling one side of the rope, slipping it though the anchor and allowing it to fall to the ground.

    To descend safely, the rope must be at least twice as long as the sum of the lengths of the pitches.

    For example, a 60 meter rope is required to rappel from a 30 meter climb, no matter how many climbers are involved.

    Climbing ropes come in 50, 60 and 70 meter lengths. It is best to take the shortest rope needed for a given climb because this saves weight. You are to determine the maximum number of climbers that can use each type of rope on a given climb.

    Input

    The input consists of a number of cases. Each case specifies a climb on a line, as a sequence of pitch lengths as in:

    N P1 P2 ... PN

    Here N is the positive number of pitches, with 1 ≤ N ≤ 100, and Pk is the positive integer length (in meters) of each pitch, with 1 ≤ Pk ≤ 100. The last line (indicating the end of input) is a single 0.

    Output
    Three numbers for each climb separated by a space, indicating the maximum number of climbers that could use the 50, 60, or 70 meter rope lengths, respectively. State 0 if the given rope length is not suitable for that climb.
    Sample Input
    1 25
    2 10 20
    0
    Sample Output
    3 3 3
    0 4 4
    Source

    样例输入

    1 25
    2 10 20
    0

    样例输出

    3 3 3
    0 4 4

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部