22048_Sequence

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

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

Pro.ID

22048

Title

Sequence

Title链接

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

AC

0

Submit

11

Ratio

0.00%

时间&空间限制

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

    Given a sequence S of n numbers and two length bounds L and U.

    Your task is to write a program to find a segment S[i], S[i+1], … , S[j] with minimum sum over all segments of S with length at least L and at most U.

    输入

    The input consists of multiple datasets. The end of the input is indicated by a line containing a zero.

    The format of each dataset is as follows.

    n

    L U

    S1 S2Sn

    Here , all data items are positive integers. n is the length of the sequence ( n ≤ 32767 ). L and U are two length bounds where LU.  S1, S2, … , Sn are the sequence of n numbers.

    输出

    Description

    Given a sequence S of n numbers and two length bounds L and U.

    Your task is to write a program to find a segment S[i], S[i+1], … , S[j] with minimum sum over all segments of S with length at least L and at most U.

    Input

    The input consists of multiple datasets. The end of the input is indicated by a line containing a zero.

    The format of each dataset is as follows.

    n

    L U

    S1 S2Sn

    Here , all data items are positive integers. n is the length of the sequence ( n ≤ 32767 ). L and U are two length bounds where LU.  S1, S2, … , Sn are the sequence of n numbers.

    Output

    For each dataset, output the minimum sum of segment, in a separate line.

    Sample Input

    9
    2 8
    -3 2 -2 5 -4 1 -2 3 1
    0

    Sample Output

    -5

    Hint

    the segment is -4 1 -2

    Source

    样例输入

    9
    2 8
    -3 2 -2 5 -4 1 -2 3 1
    0

    样例输出

    -5

    提示

    the segment is -4 1 -2


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部