21496_Alaska

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

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

Pro.ID

21496

Title

Alaska

Title链接

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

AC

19

Submit

32

Ratio

59.38%

时间&空间限制

  • Time Limit: 200/100 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    The Alaska Highway runs 1422 miles from Dawson Creek, British Columbia to Delta Junction, Alaska. Brenda would like to be the first person to drive her new electric car the length of the highway. Her car can travel up to 200 miles once charged at a special charging station. There is a charging station in Dawson Creek, where she begins her journey, and also several charging stations along the way. Can Brenda drive her car from Dawson City to Delta Juntion and back?

    输入

    The input contains several scenario. Each scenario begins with a line containing n, a positive number indicating the number of charging stations. n lines follow, each giving the location of a filling station on the highway, including the one in Dawson City. The location is an integer between 0 and 1422, inclusive, indicating the distance in miles from Dawson Creek. No two filling stations are at the same location. A line containing 0 follows the last scenario.

    输出

    Description

    The Alaska Highway runs 1422 miles from Dawson Creek, British Columbia to Delta Junction, Alaska. Brenda would like to be the first person to drive her new electric car the length of the highway. Her car can travel up to 200 miles once charged at a special charging station. There is a charging station in Dawson Creek, where she begins her journey, and also several charging stations along the way. Can Brenda drive her car from Dawson City to Delta Juntion and back?

    Input

    The input contains several scenario. Each scenario begins with a line containing n, a positive number indicating the number of charging stations. n lines follow, each giving the location of a filling station on the highway, including the one in Dawson City. The location is an integer between 0 and 1422, inclusive, indicating the distance in miles from Dawson Creek. No two filling stations are at the same location. A line containing 0 follows the last scenario.

    Output

    For each scenario, output a line containing POSSIBLE if Brenda can make the trip. Otherwise, output a line containing the word IMPOSSIBLE.

    Sample Input

    2
    0
    900
    8
    1400
    1200
    1000
    800
    600
    400
    200
    0
    0

    Sample Output

    IMPOSSIBLE
    POSSIBLE

    Source

    样例输入

    2
    0
    900
    8
    1400
    1200
    1000
    800
    600
    400
    200
    0
    0

    样例输出

    IMPOSSIBLE
    POSSIBLE

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部