GFSSOC '17 S3 - Zhany Zhanbies

View as PDF

Submit solution

Points: 12
Time limit: 1.4s
Memory limit: 64M

Authors:
Problem type

Unfortunately, on Ace's trip his bus breaks down! Looking around he sees N figures (1 \le N \le 5\,000). Having just watched The Walking Dead, he recognizes them as a horde of zombies! Looking in his car, he pulls out a small pistol. The zombies pick up his scent and begin walking towards him in a 5 columns by X rows grid (1 \le X \le 10\,000). Unfortunately, Ace being the poor programmer he is, hasn't figured out how to shoot diagonally yet. Luckily, the zombies haven't figured out how to walk diagonally either, and walk 1 square towards Ace per minute.

Ace has infinite ammunition, but his gun can hold T (1 \le T \le 5\,000) bullets at once. Ace is not a hunter, so he needs a lot of time to aim, reload, and move. In every minute, he can do one of 3 things:

  • Move - He can move 1 column to the left or right.
  • Shoot - He can expend one bullet, shooting straight down the column that he is on. Keep in mind that he cannot do this while his gun is empty.
  • Reload - He can throw out all the current bullets in his gun and put T bullets in his gun.

Ace will always move first, and his gun will always be fully loaded at the start. If any zombie reaches row 0 (The row Ace is on), they will jump on him and bite him. Ace needs your help to determine whether he will survive.

Ace always starts in column 1.

If Ace cannot survive, output Never lucky, Ace.. If Ace can survive, output You can do it, Ace!.

Input Specification

The first line will contain integers N, X, and T.

The next N lines 2 \dots N+1 will contain I (1 \le I \le 5), the column and J (0 < J \le X), the row, specifying the location of each zombie.

Output Specification

Output either Never lucky, Ace. or You can do it, Ace! based on his eventual fate.

Sample Input 1

3 6 2
1 1
2 3
3 6

Sample Output 1

You can do it, Ace!

Explanation for Sample Output 1

Ace shoots the zombie at (1, 1), and then moves to column 2, where he shoots the second zombie who has advanced to (2, 1). The third zombie has advanced to (3, 3) by this point. Ace moves to the 3rd column, reloads, and then shoots the zombie and survives.

Sample Input 2

2 2 1
1 1
2 1

Sample Output 2

Never lucky, Ace.

Explanation for Sample Output 2

Ace shoots the first zombie, but his poor single-shot gun can't shoot fast enough! The second zombie kills him while he's reloading.


Comments


  • 1
    splacorn  commented on April 1, 2017, 5:40 a.m. edited

    anyone here from ioiqrp6?


  • 5
    tig567899  commented on Jan. 20, 2017, 5:57 p.m. edited

    Your random number generator is not appreciated.


    • 0
      jimgao  commented on Jan. 20, 2017, 7:19 p.m. edited

      same


      • 0
        tig567899  commented on Jan. 20, 2017, 7:26 p.m. edit 2

        This thing has been fixed - I don't think an RNG will work anymore.


        • 1
          BenjaminBLi  commented on April 18, 2017, 2:49 a.m. edited

          RNG still works. I checked.