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

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

We invite you to participate in CodeChef’s Starters118, this Wednesday, 24th January, rated for till 5-Stars (ie. for users with rating < 2200).

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

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!

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

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

Can you make sure the editorials for the previous Starters 117 are complete? The code for Expected Diameter problem is missing.

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

Finally, here is a contest.

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

How to solve WATERBUCKETS

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

    Divide the array into blocks of size $$$O(\sqrt n)$$$. The size of the water bucket is fixed. For each $$$i$$$, compute the minimum number of buckets you need to escape the block and the amount of water left in the last bucket if you start at $$$i$$$. This you can do by Segtree walk in $$$O(log_2(\sqrt n))$$$. Now to process an update, just update the block. To process queries, you can jump from block to block using this structure fast. Total complexity $$$O(n \sqrt n * log_2(\sqrt n))$$$.

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

anyone has the idea how to solve "Is it uniquely decodable?"

I tried a dp solution , in this I got the idea that , all subsequences that ends with a will consist of all the subsequences of previous a only , similarly for all b it can consisit of previous b

https://www.codechef.com/viewsolution/1041477881

Here is what i tried its wrong but what was the idea

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

Can anyone please tell me why this solution is giving WA for this problem (Subcount).

I have used matrix exponentiation to solve it.

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

how to solve SUBCOUNT task?