DMOPC '16 Contest 2 P1 - Seed Strategy

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Kira is fighting the ZAFT forces in space, stopping chairman Durandal's plans to rule the Earth. Unfortunately, his mech, the Strike Freedom has sustained major damages throughout the battle. Being the genius that he is, he calculates that he has N minutes left before the Strike Freedom shuts down. Even worse, there are still K enemies nearby, with power levels in the range [1, 3].

  • Power level 1 grunts will take 30 seconds to defeat
  • Power level 2 elites will take 1 minute to defeat
  • Power level 3 aces will take 5 minutes to defeat

Because he spent all his time calculating how much time he has left, he needs you to figure out if he has time to defeat all the enemies or to make a tactical retreat.

Input Specification

The first line of the input will contain an integer N (1 \le N \le 10\,000), representing the amount of time before the Strike Freedom shuts down.

The second line will contain an integer K, representing the number of enemies left.

The next K (1 \le K \le 10\,000) lines will each contain an element i (1 \le i \le 3), representing the power level of that enemy.

Output Specification

If Kira can defeat all the enemies before his mech shuts down, output Continue. Otherwise, output Return.

Make sure your output matches this exactly, including capitalization.

Sample Input

10
6
1
1
2
3
1
2

Sample Output

Continue

Explanation

We know that Kira has 10 minutes to defeat all 6 enemies. There are 3 Power level 1 enemies which is 3 \times 0.5 = 1.5 minutes, 2 Power level 2 enemies which is 2 \times 1 = 2 minutes and 1 Power level 3 enemy which is 1 \times 5 = 5 minutes. In total, it will take 1.5 + 2 + 5 = 8.5 minutes which is less than the 10 minutes given, therefore, Kira can continue to fight.


Comments


  • -1
    lolpeterblox1  commented on March 21, 2020, 9:25 p.m.

    What's wrong with my solution? Everything's correct except the 9th test.


    • 0
      Dingledooper  commented on March 21, 2020, 9:39 p.m.

      If 1 is 1 minute, then .3 is not 30 seconds.


  • 0
    mrglioula  commented on Nov. 12, 2017, 12:19 p.m.

    i need a judge here!!! my answer is correct exept the last test why why why why why :(


    • 1
      injust  commented on Nov. 12, 2017, 8:29 p.m.

      Power level 2 elites will take 1 minute to defeat


      • 1
        mrglioula  commented on Nov. 14, 2017, 2:07 p.m.

        tnx bro i fixed it