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 near by, 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 amount 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.

not sure why i need this


Report an issue

Comments


  • 0
    mrglioula
     commented on Nov. 12, 2017

    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

      Power level 2 elites will take 1 minute to defeat


      • 0
        mrglioula
         commented on Nov. 14, 2017

        tnx bro i fixed it


      • 0
        TypicalToxic
         commented on Nov. 13, 2017

        a=a+2.0?


  • -1
    ChaSiu
     commented on Oct. 2, 2017

    Typo

    he calculates that he as N minutes...


    • -1
      kobortor
       commented on Oct. 3, 2017

      Fixed


  • -1
    paydayzcool
     commented on Nov. 11, 2016
    Spelling error

    10 minutes given, there for, Kira can continue


    • -1
      Kirito
       commented on Nov. 11, 2016

      Fixed.


  • -1
    Kirito
     commented on Nov. 8, 2016
    Typo

    and 1 Power level 3 enemie which is


    • 0
      whycolt
       commented on Nov. 8, 2016

      Fixed, arigato gozaimasu


    • -1
      whycolt
       commented on Nov. 8, 2016

      Top tier right?