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

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

We invite you to participate in CodeChef’s June Lunchtime, this Saturday, 26th June, from 7:30 PM — 10:30 PM IST.

There will be 7 problems in Division 3 and 6 problems in Division 1/2.

Joining us on the problem setting panel are:

Problem Submission: If you have original problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Prizes: Top 10 Indian and top 10 Global school students from ranklist will receive certificates and CodeChef laddus, with which they 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.

Admin Note: This Lunchtime has a replay of some of the problems used in IOITC Day 2/3 (Final Selection round of Indian IOI Team). Thanks to all the testers who tested the IOITC as well!

Good luck and have fun!

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

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

Reminder that contest starts in 90 minutes

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

As a participant of Indian TST, I feel the quality of problems is one of the highest compared to all other OIs this year.

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

Less than 2 minutes

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

Div3 and Div1 problems are interchanged. It should be fixed soon.

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

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

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

Hope you guys will do plag check this time :\

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

Nice problemset.

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

Why is below code giving TLE verdict for "From rational to binary" problem ??

Spoiler
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

My last ~1.5 hours of the contest: :( internal error occurred in the system

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

How to do Node Marking ?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +14 Проголосовать: не нравится
»
5 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится +15 Проголосовать: не нравится

I calculated the DP in another way in problem NDMRK since I was scared the tree DP wouldn't be $$$O(N * K)$$$.

Run an euler tree and store the ranges that each node's subtree covers and sort these ranges by start point. Note that we have the special property that for any two ranges, one wholly covers the other or their intersection is empty.

Now let $$$dp[i][j]$$$ be the minimum number of ranges to select in the last $$$i$$$ ranges to color exactly $$$j$$$ nodes. Transitions here are extremely simple:

  • Suppose we choose the last $$$i$$$ th range. Let $$$\text{nxt}$$$ be the first range after this one that does not intersect with the current range. Then, $$$dp[i][j] = dp[\text{nxt}][j - \text{len(ith range)}]$$$
  • Suppose we don't choose the last $$$i$$$ th range. Then $$$dp[i][j] = dp[i + 1][j]$$$.

Set $$$dp[i][j]$$$ to the minimum of these two values. Since transitions are $$$O(1)$$$, this dp runs in $$$O(N * K)$$$. The rest of the solution proceeds as the editorial does. Here is my code.