Page 3 of 3

Re: 11850-Alaska

Posted: Mon Jul 21, 2014 10:03 am
by lighted
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:

Re: 11850 - Alaska

Posted: Sat Nov 22, 2014 2:11 pm
by ehsanulbigboss
AC!

Re: 11850 - Alaska

Posted: Sat Nov 22, 2014 4:48 pm
by lighted
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.