Блог пользователя amnesiac_dusk

Автор amnesiac_dusk, история, 3 года назад, По-английски

We invite you to participate in CodeChef’s November Cook-Off, this Sunday, 22nd November, from 9:30 pm to 12:00 am IST. 2.5 hours, 5 problems.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Joining us on the problem setting panel are:

Prizes: The top 10 Indian and top 10 Global participants will receive CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here.

The video editorials of the problems will be available on our YouTube channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Good luck and have fun!

  • Проголосовать: нравится
  • +166
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +38 Проголосовать: не нравится

Gentle Reminder: Contest starts in ~150 minutes.

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Unbalanced contest :(

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Could have had a better difficulty gradient (C was much tougher than B, which made the contest speed forces), but other than that, nice contest.

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Uh is it just me or did the contest length change to 3 hours?

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Yeah

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится +5 Проголосовать: не нравится

      Ah, I reloaded the page a few minutes later and saw the announcement. I do find the addition of a problem during the contest to be rather sketchy though.

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +5 Проголосовать: не нравится

    This is actually really bad management of codechef, no announcement whatsoever. Everywhere its still written 2.5 hour.

»
3 года назад, # |
  Проголосовать: нравится +79 Проголосовать: не нравится

Div-1 was perfectly balanced as all things should be. Thanks for the round.

»
3 года назад, # |
  Проголосовать: нравится +46 Проголосовать: не нравится

:P the Wikipedia page that was linked in the problem statement for Set Queries had the solution.

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How to solve "Hiring Workers" ?

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    We can see that the lcm of all groups should be equal to x so we can first divide the number x into coprime factors such as x=(p1^c1)*(p2^c2)... where p1,p2.. are prime numbers now if k is greater than or equal to the the number of prime factors we assign the remaining groups as 1.

    If k is less than the number of prime factors we can check by brute force as x cannot have more than 7 distinct prime factors and even if k is 6 we have to check 6^7 cases.

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      How in the world will someone know the upper cap is 7! You must be a genius to figure that out. Kudos.

      • »
        »
        »
        »
        3 года назад, # ^ |
          Проголосовать: нравится +9 Проголосовать: не нравится

        Just multiply the smallest 8 prime numbers.

        • »
          »
          »
          »
          »
          3 года назад, # ^ |
            Проголосовать: нравится +8 Проголосовать: не нравится

          Thank you, that's really neat. I spent about 2 hours and I couldn't figure that out. I was trying to come up with a some greedy approach. This proves I'm dumb!

    • »
      »
      »
      3 года назад, # ^ |
      Rev. 2   Проголосовать: нравится +10 Проголосовать: не нравится

      There's a way to do it using bitmask dp too (by iterating over submasks), in like P^2*3^P time or something (don't exactly remember the complexity), where P is the number of prime factors of X and P<=7.

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Video editorials for 4 problems have been uploaded here. The other 3 videos will be uploaded over the next day or two.

»
3 года назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

For HIRINGWO can someone tell whether there was another approach other than brute force when $$$k$$$ was less than number of distinct prime factors? that was like $$$6^{8}$$$.

Also for KDIAMS do we make graph with diameter 2 only no?

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

In hiring workers problem, I find a pair of least sum and having LCM x and then added k-2(k-2 groups having only 1 worker) to sum of pair. what went wrong in my approach? Somebody please help

»
3 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Nice problem set but too many observation related problems :(

»
3 года назад, # |
Rev. 3   Проголосовать: нравится +10 Проголосовать: не нравится

https://youtu.be/nTAQi-7fd1E made a video on Hiring workers. Give it a watch if you are stuck.