dedsec_29's blog

By dedsec_29, history, 13 months ago, In English

Hello Codeforces!

Greetings from DJS Codestars, the official Coding committee of DJ Sanghvi College of Engineering.

We are organizing an ACM-style-based contest Code Uncode 6.0 on Codechef. The contest will be held on 17th April 2023 from 15:00 IST to 18:00 IST

Participants will be given 3 hours to solve 8 problem statements, with increasing difficulty. Stand a chance to win super exciting cash prizes!

Date : Monday, April 17th, 2023 at 3:00 pm IST
Duration : 3 Hours
Registration Link: (https://www.codechef.com/CDUN2023)

Heartfelt thank you to our testers: weakestOsuPlayer_244, 18o3, Queue, dkg7888 and Omja

Fill in the form to be eligible for prizes and receive all future announcements/updates

Instructions / Rules :

We hope you enjoy the problems as much as we enjoyed making them.
Good luck, happy coding!

UPD:

Here are the Winners!

1st place ShlokG

2nd place IceKnight1093

3rd place shadow9236

Editorials:

FASTWAY
BHEEM69
PLANETS
JAADU69 (to be added soon)
PLANETREE
ABCHEAT
DAFF69

  • Vote: I like it
  • +57
  • Vote: I do not like it

| Write comment?
»
13 months ago, # |
  Vote: I like it +17 Vote: I do not like it

Damn , it was fun last time with kalash coming in at last moment and grabbing all the prizes

»
13 months ago, # |
  Vote: I like it +10 Vote: I do not like it

Will the winner get to meet DJ sanghvi??? 😍😍😍😍

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by dedsec_29 (previous revision, new revision, compare).

»
13 months ago, # |
  Vote: I like it -10 Vote: I do not like it

is it rated ? @dedsec_29[user:dedsec_29] does it will have any affect on rating of CodeChef.

»
13 months ago, # |
  Vote: I like it +9 Vote: I do not like it

rr sir orz ✨
also dedsec saar orz ✨, sayan sir orz ✨.

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by dedsec_29 (previous revision, new revision, compare).

»
13 months ago, # |
  Vote: I like it +6 Vote: I do not like it

As a tester, I enjoyed testing the problems! Everyone has done their best to prepare an enjoyable contest. Therefore, I look forward to your participation!

»
13 months ago, # |
  Vote: I like it +6 Vote: I do not like it

It was great participating last year. Hope this year turns out to be fun as well !!

»
13 months ago, # |
  Vote: I like it +6 Vote: I do not like it

As a tester of this contest, I liked the problems and encourage everyone to participate in it. Best of luck folks!

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Problem Link: Alice and Bob Cheat

My Approach: Considered the string and the array in reverse order. Calculate the prefix function, pi where pi[i] is the length of the maximum proper prefix of the substring s[0...i] which is also suffix. Built sparse table on prefix sum of the given score array. For every positive value of pi, fixed the segment of length pi which ends at i. Then query for a maximum value in this segment and subtract the necessary part for getting the exact maximum prefix sum on this segment. Also get the maximum value of the segment starting at 0 of length pi[i]. Then ans is the maximum of this two value over all possible pi value. I was getting WA with this approach.
Can anyone help me finding out the fault of my approach?
TIA

  • »
    »
    13 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it
    TestCase
    Your Output
    Correct Output

    PS: I was also once trying similar solution, and then realised that it's incorrect.

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Problem Tree Limit Exceeded my solution is giving TLE.

I have used the following :

  • A vector of priority queue to store that height maxm height of tree for any ith planet
  • A map of multiset , which store index of all planet for height h. This i require to get hold of planet from which tree of maximum height is removed
  • A segment Tree to find maximum element in range [l,r].

First of all i have initialized the seg tree using the maxm element for all planet. Then if we want to remove tree with max height in range [l,r]. Then I find out maxm height using segment tree. Then use maxm height to know the index of the planet using map (ii). Erase that element from map. Erase top element of that priority then finally update the segment tree if required.

Can anyone help me to get rid of TLE. Please let me know if any of the step in my solution is redundant.

Thank you

  • »
    »
    13 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    U don't need map of multiset. In segment tree store maximum_height of planet in current range and the index of the planet, in case of equal height choose minimum index.

»
13 months ago, # |
  Vote: I like it +4 Vote: I do not like it

Nice problem set, totally enjoyed this!!

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by dedsec_29 (previous revision, new revision, compare).