Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор dedsec_29, история, 18 месяцев назад, По-английски

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

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

»
18 месяцев назад, # |
  Проголосовать: нравится +17 Проголосовать: не нравится

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

»
18 месяцев назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

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

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

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

»
17 месяцев назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

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

»
17 месяцев назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

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

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

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

»
17 месяцев назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

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!

»
17 месяцев назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

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

»
17 месяцев назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

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

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

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

  • »
    »
    17 месяцев назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится
    TestCase
    Your Output
    Correct Output

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

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

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

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

    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.

»
17 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

Nice problem set, totally enjoyed this!!

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

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