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

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

Invitation to CodeChef Starters 110 (Rated till 5-stars) — 29th November

We invite you to participate in CodeChef’s Starters 110, aka Shaastra Programming Contest , conducted by Shaastra IIT Madras and sponsored by KLA+, this Wednesday, 29th November, rated till 5-stars (ie. for users with rating < 2200).

Time: 8:00 PM — 10:00 PM IST

Register here to be eligible for the offline finals where there are prizes worth 60000 INR.

Joining us on the problem setting panel are:

Written editorials will be available for all on discuss.codechef.com. Pro users can find the editorials directly on the problem pages after the contest. The video editorials of the problems will be available only to Pro users.

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.

Hope to see you participating.

Good Luck!

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

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

what is error in this https://www.codechef.com/viewsolution/1032623090 for Tom and jerry problem

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

In the problem "World Cup", any pointers as to why the following idea doesn't work?

  • Consider I take some set $$$S$$$ ($$$|S| \lt n$$$) of matches such that the shortest unused match has length $$$y$$$. Then it is clearly optimal to distribute the matches in $$$S$$$ with a gap of $$$y - \epsilon$$$ between them. Practically this means I can cover a period of $$$(|S| + 1) \cdot y - 1 + \sum_{x \in S}{h_x}$$$ days without being able to fit any match.

Since:

  1. $$$y$$$ clearly depends on selecting all matches with length $$$\lt y$$$.

  2. For a fixed $$$y$$$ and |S|, we want to maximize $$$\sum_{x \in S}{h_x}$$$ by picking the largest remaining possible values.

  • From (1) and (2), any optimal set of matches consists of a combination of the $$$i$$$ shortest matches and the $$$j$$$ longest matches.

  • So we can just iterate over the values of $$$i$$$ and $$$j$$$ and find the minimum value of $$$i + j$$$ which satisfies $$$(i + j + 1) \cdot a_{i + 1} - 1 + \sum_{x = 1}^{i}{h_i} + \sum_{x = 0}^{j - 1}{h_{n - j}} \geq H$$$.

I feel like I'm misunderstanding something key about the problem or approach.

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

Why in the world a $$$dp[N][2][2]$$$ solution gives TLE in tetris?

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

Cant understand why this is wrong . please help ! https://www.codechef.com/viewsolution/1032506038