kevinsogo's blog

By kevinsogo, history, 20 months ago, In English,

Hello Codeforces Community!

I invite you all to join HackerRank's HourRank 27 on April 2, 2018, at 20:30 IST.

You will be given one hour to solve three tasks. The contest will be rated and the top ten contestants will receive HackerRank T-shirts!

The problems are prepared by guptautkarsh028, svanidz1, pkacprzak, wanbo and myself (kevinsogo). I suggest you read all of them. I hope you'll like them!

Good luck and happy coding! Also, happy April Fools' Day! (This announcement is not an April Fools joke.)

 
 
 
 
  • Vote: I like it
  • +19
  • Vote: I do not like it

»
20 months ago, # |
  Vote: I like it +6 Vote: I do not like it

Did anyone receive prizes from the last HourRank yet?

»
20 months ago, # |
Rev. 4   Vote: I like it 0 Vote: I do not like it

Can any1 tell me for what test cases my code is wrong for maximizing the profit problem?? code

  • »
    »
    20 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I tried test case:

    3

    -2 - 1 1

    It's printed -1, but the answer is (-2) * (-1) * (1) = 2.

    • »
      »
      »
      20 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      It's showing 2??

      have a look!!

      https://ideone.com/l3pl7b

      • »
        »
        »
        »
        20 months ago, # ^ |
        Rev. 3   Vote: I like it 0 Vote: I do not like it

        Wow, it showed me -1. OK, i changed it:

        5

        -8 -10 -4 -6 10

        It's printed 480, but i can take: (-10) * (-6) * (10) = 600.

        UPD: It's not always the best way to take as large as possible number, which is less than current, in this test case it's better to take the least one.