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

Автор vaibhavjaimini, 8 лет назад, По-английски

Hello Codeforces Community,

HackerEarth March Easy'17 will start at 9:30 PM IST on 1st March. The contest is of 3 hours. It will be a rated contest and is open for everyone.

There will be 6 algorithmic problems of various difficulty level. Problems are prepared by me (vaibhavjaimini). They have been thoroughly tested by usaxena95 and editorials are prepared by r3gz3n. Thanks to belowthebelt and r3gz3n for their help in preparing this contest and to MazzForces for his feedback on problems. This is the first time I am preparing a contest, so it'll be great to have some feedback.

Prizes: Top 5 beginners (1st year or 2nd year) will receive HackerEarth Tshirts.

Hope you'll enjoy the problems. Good luck and happy coding!!.

UPD: Contest starts in 30 minutes.

UPD: Contest is over. Here are the top 5:

  1. uwi
  2. HellKitsune
  3. Deemo
  4. rubabredwan
  5. Kaban-5

Kudos to everyone who participated!! Editorials will be live soon. Any feedback or discussion on problems is welcome.

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

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

Since editorial is not uploaded till now for this problem : Micro and Lucky Tree Can someone explain the approach for this ?

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

    I solved this problem with a dp[atualNode][currentGcd]. The base case is when a node is a leaf. In this case, the answer is 1 if a gcd(currentGcd, numberInLeaf) is 1. For other nodes, you can choose any number between 1 and m to atualNode, and continue solve for child nodes. The answer for node atualNode is a multiplication of all pair of child nodes.