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

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

We invite you to participate in CodeChef’s September Cook-Off, this Sunday, 20th September, from 9:30 PM to 12:00 AM IST.

2.5 hours, 5 problems.

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.

Joining us on the problem setting panel are:

Prizes:

The top 10 Indian and top 10 Global participants will receive CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here.

Good luck and have fun!

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

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

How to solve Joined Subarrays on Tree? Can someone help me find what's wrong with my solution? I was struggling with it for 1.5h. https://www.codechef.com/viewsolution/38064446

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

    I havent undrastand your solution but your code is so so so clean! Good job

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

    I used the same approach bro and was stuck for around 1 hour

    If anyone finds a testcase, do share :-)

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

      It fails on test 33234, I dont know why I was convinced that it is correct ;p

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

        The answer should be 4 ryt??

        If yes, I guess my solution was different after-all -My approach

        If anyone finds a testcase , do share becoz its killing me as I have tried loads of testcases...

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

The contest is over. Editorials are uploaded at Codechef Discuss. So, you can check them out.

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

    The Editorial of GPHLBL is not there. Will it be posted later?

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

      Oh. I think yes. short explanation: We can construct scc of input graph. we can reduce constraints such that we finally have some constraints that c1 type edges incoming or outgoing for a particular connected component or node are between l to r. Now, let us assume c1<c2 without loss of generality. Now, let us create a flow network where flow models the number of c1 type edges. Now, we can create a four layer graph where source to first layer represents the scc's outgoing demands, first to second layer represents node's outgoing demands. Second to third layer, represents the edges, third to fourth layer represents node's incoming demands and fourth to sink represents scc's incoming demands. These can be done with flow with lower bounds which is standard problem.
      Besides, The editorial will be uploaded soon. I wrote this on phone so sorry for mistakes or unclearness. Code for reference: https://ideone.com/GDb7oa

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

        Thank you! I think you can just post your explanation as editorial because it's clear enough.

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

Please provide better samples and also include explanations next time. I see no harm in doing it.

A good sample or sample explanation helps us resolve any misunderstanding of the problem. I spent a good 45 mins thinking, coding and testing a problem I misunderstood

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

    In Maximise Subsequence Value ,I have done the silly mistake ,I was printing the position of elements in 0 based indexing ,as a result I got 3 WA. submission link . Codechef should add the feature to show the verdict on samples test cases(Accepted or Wrong answer)

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

I disliked weak samples and the lack of explanations for them -_-

Interesting fact: while everything else was quite easy, it took me half an hour to come up with a solution for the easiest problem, MVAL https://www.codechef.com/COOK122A/problems/MVAL

my screencast: https://youtu.be/RCwIm5toNhc

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

Weak test cases in Bulbs

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

    Many of the have passed for : 11 2 00010000100 The answer is 4 but a lot of submission giving answer 5 have been passed.

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

Can someone please explain the question of minimum insertion? I am not understanding what the question means.

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

The explanation of the problems was not so clear!

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

Problems were toooo hard!!

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

I was able to solve 0 problems in this contest!

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

Is it just me who found the problem statement for MININS... extremely poor

too many nots and the irrelevant use of the word subsequence...

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

    Yes, I also found the statement very confusing. Assuming I now understand it correctly, I guess they could have just written:

    For each $$$K$$$ from $$$2$$$ to $$$N$$$ inclusive, find the smallest possible number of elements that need to be inserted into $$$A$$$ to form a sequence $$$B$$$, such that all continuous subarrays (in a circular sense) of $$$B$$$ of size $$$K$$$, have at least one pair of consecutive elements which are co-prime.

    That would be much clearer, I suppose. (Ignoring the fact that I still couldn't solve it).

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

Here, is the official video editorial for MVAL [I have tried to keep the solution short and simple]. The question was quite easy but got surprisingly less number of submissions in Div B. I think most of the users either misread the question or didn't read the question at all! Let me know if you found the video editorial useful :)