11850 - Alaska

All about problems in Volume 118. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 11850-Alaska

Post by lighted » Mon Jul 21, 2014 10:03 am

Brenda must drive her car from Dawson City to Delta Juntion and back.
In the input above she charges her car for the last time at station 1300.
It is enough to reach Delta Junction, Alaska 1422 mile. She spent current charge for 122 miles.

But she must return back. And there is no station at Delta Junction, Alaska 1422 mile (in this input last station is at 1300).
Now she can drive only 78 miles and charge will be over. She can't reach station at 1300.
So it is impossible to return back. :wink:
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman

ehsanulbigboss
New poster
Posts: 32
Joined: Tue Jul 22, 2014 1:17 am

Re: 11850 - Alaska

Post by ehsanulbigboss » Sat Nov 22, 2014 2:11 pm

AC!
Last edited by ehsanulbigboss on Sun Nov 23, 2014 12:17 am, edited 1 time in total.

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 11850 - Alaska

Post by lighted » Sat Nov 22, 2014 4:48 pm

Input

Code: Select all

8
1401
1200
1000
800
600
400
200
0

9
1421
1400
1200
1000
800
600
400
200
0

0
Acc Output

Code: Select all

IMPOSSIBLE
POSSIBLE
Read problem description again. Condition "if (array[i+1] - array < 200) { puts("IMPOSSIBLE");" is not correct.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman

Post Reply

Return to “Volume 118 (11800-11899)”