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

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

Hello Codeforces community,

I would like to invite you all to Coders’ Legacy 2020, the contest held annually by KeyGEnCoders, the programming club and CodeChef Campus Chapter of Kalyani Government Engineering College. This contest will be rated for both divisions .

The contest starts on 15th July at 21:00 IST . You will have 3 hours to solve 7 problems. The ranklist will be ICPC style with the penalty set to 20 minutes.

The problems have been prepared and tested by me, avijit_agarwal, its_aks_ulure, souradeep.99 and indrajit1. I would also like to thank l_returns, jtnydv25, nagpaljatin1411 and taran_1407 for providing valuable feedbacks and helping us set up the contest.

There are laddus for top performers as well. Please check the contest page for more details.

Good luck. :)

UPDATE 1: Contest starts in 30 minutes. All the best.
UPDATE 2: Contest starts in 2 minutes. All the best. UPDATE 3: Contest has ended. Thanks for participating.

The problems have been moved to practice session. The editorials can be found at https://discuss.codechef.com/search?q=cole2020%20%23editorial.

Congratuations to the winners:
1. uwi
2. html_sanek
3. solaimanope
4. sam__2
5. progmatic

There were certain issues during the contest. We sincerely apologise for that.

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

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

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

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

:orz:

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

With Codechef contests, I never know what quality to expect. Is this another random contest made by an arbitrary university and just hosted on Codechef? Or is it official like Cook-offs and Lunchtimes?

It's clear on Codeforces as there is GYM tab with trainings and unofficial competitions.

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

    Actually, since this contest is rated for both divisions, the problems have been verified and tested by the CodeChef admins. Therefore, you can expect a decent problemset in this contest. We'll be more than glad to hear the feedbacks from you after the contest.

    We hope to see you in the ranklist. :)

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

    You can also check their last year's problem set. Coders' Legacy 2019 (Rated for all). It was combined rated round for all.
    Although previous rounds don't promise that next round will be good as well. But still can be a good estimate about the upcoming round's quality.

    The random contest made by an arbitrary university is never rated if CodeChef admin's feel it's not up to the mark of their regular rated (Cook-Off, Lunchtime or Long) contests.
    In case of a bad quality round. They also own partial responsibility along with setters/testers.

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

sarthakmanna will you provide the editorials, I would love to learn from nice problems :)

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

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

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

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

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

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

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

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

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

What is the point of keeping $$$10^7$$$ inputs in an already implementation heavy contest?

If the questions are not challenging enough idea-wise, I don't think increasing the constraints to forcefully make the implementation harder is the way to go.

  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится -40 Проголосовать: не нравится

    The time limits have been verified by multiple testers. Try to come up with a more optimised solution.

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

      I used cin,cout with ios_base in 3rd problem and wrote a O(n) solution and it gave me tle 5 times until i used scanf,printf.There should not be this strict bound on constraints.This is always an issue on codechef.

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

Is it just me getting 500 error always or this is common?

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

Codechef seems down, is it still rated ?

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

sarthakmanna I submitted Door fires bracket and after that page was showing error . I refreshed and after 10 minutes it got submitted . But in my submissions it is showing submitted two times . So i have got 40 minutes penalty whereas i deserved only 20 minutes . Please look into this .(You can see both submissions are exactly same and why i will submit same solutions two times ?)

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

.

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

I don't understand the change in output format of CLLEXO. Should we now output all answer string separated by space?

  • »
    »
    4 года назад, # ^ |
    Rev. 3   Проголосовать: нравится +10 Проголосовать: не нравится

    The format is still same as shown in sample output. There was a typo in the statement which is fixed now.

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

I don't have high expectations from Codechef contest but this was a good contest ...It keeps me engage for the 3 hours ...We can't be too negative always about certain things... Thank you so much

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

Thanks for such good problems :)

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

How to solve Unique Substring faster than n log^2 n?

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

    $$$n\log{n}$$$ sufarray, for all $$$l$$$ find $$$\min(r\,\colon\,s[l,r]\text{ is unique})$$$ and write $$$i$$$ at the point $$$(l, r)$$$, where $$$i$$$ is the position of $$$l$$$ in the sufarray, then each query $$$(l, r, k)$$$ can be reduced to looking for the minimal number in the rectangle with $$$l \leq x \leq r - k + 1$$$ and $$$y\leq r$$$. Build a segment tree for $$$x$$$'s where in $$$[x_l, x_r]$$$ we store all pairs $$$(r, i)$$$ where the number $$$i$$$ is written in $$$(l, r)$$$ and $$$x_l\leq l\leq x_r$$$, sorted by $$$r$$$, then we sort queries $$$(l, r, k)$$$ by $$$r$$$ and iterate over them in this order, lazily maintaining the minimal $$$i$$$'s in the segtree's nodes, thus making $$$O(n\log{n})$$$ single modifications in total.

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

Problems were nice.How to solve 4th problem ?
PS: not able to figure out what is wrong with my code :(

  • »
    »
    4 года назад, # ^ |
    Rev. 3   Проголосовать: нравится +9 Проголосовать: не нравится

    DFS from n,m node and mark all nodes which can lead to it. Do a BFS kind of soln from 1,1 and go to nodes which are valid and having minimum char at particular depth. ( Basically solve diagonally )
    Time complexity O(n*m)

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

      Thanks!!

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Probably an implementation mistake in 2nd part, 1st part I did fine,i guess.

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Can you elaborate a bit because i am confused that by solving diagonally and taking the minimum will it always give correct.For example what if we take the minimum from 1st level and then the minimum from 2nd level then the minimum in the 2nd level may not come from the same path as in level 1.

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Solving diagonally basically means solving level wise and taking the minimum at a particular level while checking if the path from that particular minimum node is valid. Am I getting right?

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You can see the editorial here.

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

problem C was purely data structure based(Stack, Queue). I liked it a lot. It's not like it was very easy. It might be a very good problem for Div2-B at least. That's what some people are saying if some(say 1) such data structure based problem will appear in Div2 then it will be great. However I am agree that it's difficult to create such problem.

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

How to solve CLLEXO? I was trying to compare right and below character but could not decide in case both are equal. Thanks

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

Is there a non cancer way of solving CLBIT. I came up with a persistent segment tree + segment tree beats + LCA, but sadly couldn't implement it.

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

Ahh, Phineas and Ferb. You shall forever have my heart <3

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

Somebody please tell me what's the logic of the 2nd problem?

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You can use binary search to solve it.

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

      My logic was to draw a perpendicular line to x=y and check where it's intersection lied. All midpoints of the walls would lie on x=y so the coordinate of intersection should let us know which wall it was lying close to. (Yes I used lowerbound binary search)

      I don't know what's wrong with this approach. Anybody can help me figure out?

      • »
        »
        »
        »
        4 года назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        This soln seems correct. Maybe you did some mistake in implementation. However I convert every wall into a value. x+y For each query (x1,y1), just add them. Check how many walls have x+y < x1+y1 and so on..

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

          I also did that lol. I tried with dividing by 2 and then I just did by normal addition since I knew both coords like on x=y and the intersection have same division by 2.

          It totally messed this contest ..

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

    Each wall is a straight line of the form x+y=a. For a point (x1, y1) to lie outside the line, x1+y1>a should satisfy. So for each point, you just have to find the last line/wall such that it is outside the line/wall. This can be done by binary searching (x1+y1) in the array of sorted walls.

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

Thank you for such a nice problem set :)

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

Not bad problems!

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

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

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

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

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

It was a nice problemset .

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

Hey! Can someone help me in finding what test cases my code for CLLEXO is failing? My Solution

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится -7 Проголосовать: не нравится

    sarthakmanna avijit_agarwal First I found out all the cells reachable from n,m. Then I did the queue implementation of bfs starting from 1,1 which took the coordinates of the cell and the letter in its parent cell as input. For the lth character of my answer I considered all cells with i+j-1=l and having parent cell equal to the (l-1)th character of the answer string.

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

    I don't know exactly which test cases are failing in CodeChef. But your code fails on this test:

    2
    2 3
    zba
    bbb
    2 3
    zb
    bb
    ab
    

    The answer for both of the cases should be same: zbab. But on first test case, your solution prints zbaz.