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

Автор mgch, история, 9 лет назад, По-английски

Hello CodeForces Community! Chef's next contest is just around the corner and I'd like to invite you for the same, the March Lunchtime 2018. Have a helping of Chef's challenges and solve all 6 contest problems to top the charts!

I hope you will join your fellow programmers and enjoy the contest problems. Joining me on the problem setting panel are:

  • Problem Setter:mgch (Misha Chorniy)
  • Problem Tester: Lewin (Lewin Gan)
  • Problem Editorialist: adkroxx (Adarsh kumar)
  • Problem Admin: kingofnumbers (Hasan Jaddouh)
  • Statement Verifier:Xellos (Jakub Safin)
  • Russian Translator: CherryTree (Sergey Kulik)
  • Mandarin Translator: huzecong (Hu Zecong)
  • Vietnamese Translator: VNOI Team

I hope you will have a great time solving them. Your feedback on the problem set is most welcome in the comments below after the contest.

Contest Details:

Time: 31st March 2018 (1930 hrs — 2230 hrs). (Indian Standard Time — +5:30 GMT) — Check your [timezone]https://www.timeanddate.com/worldclock/fixedtime.html?msg=March+Lunchtime+2018&iso=20180331T1930&p1=44&ah=3.

Contest link: https://www.codechef.com/LTIME58

Registration: You just need to have a CodeChef handle to participate. For all those, who are interested and do not have a CodeChef handle, are requested to register in order to participate.

Prizes: * Top 10 performers in Global and Indian category will get CodeChef laddus, with which the winners can claim cool CodeChef goodies. Know more here: https://www.codechef.com/laddu.

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

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

I think this is the first time when there will be 6 problems in LunchTime.

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

Codechef site down??

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

Is it just me or nobody is able to see the problems ?

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

can't access problems , server down :(

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

Servers down.

What a classic codechef mess-up.

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

I think we all should stop reloading the page to reduce load from their servers.

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

Atleast change the contest time by half hour so that problems don't appear suddenly.

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

15 minutes have passed no responses from them :(

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

Seems like April has arrived a day early this year xD

»
9 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится -25 Проголосовать: не нравится

BeautyofCodechef

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

Is div2 having the same problem?

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

It's UP

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

Seriously, after 40 minutes they just put it up without warning. That's ridiculous. Should've just turned it off and postponed with an hour. Was everyone expected to eagerly refresh for 40 minutes straight?

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

Contest page is not showing correct number of accepted submissions(for div 1)!

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

Is it showing for anyone??

"You will have to login to check the contents on March Lunchtime 2018 Division 1 contest page.

Note: This is a restricted contest. It will only be accessible to users who are provided the permission. In case of any queries, please get in touch with the contest organizer."

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

Massive error in judgement there :(

Should have postponed it for an hour or so. First they display the problems all of a sudden without fixing the full issue. And now it seems the contest is "restricted". At least I am not able to see the contest page anymore.

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

I solved 3 problems and they made the contest restricted. It would have been a good one for me. :(

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

Wow! Final Exam tomorrow and ruined almost one and a half hour for nothing! -_-

Untitled

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

Site offline now I guess.

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

mgch: questions are still accessible on direct link of the questions, please disable it.

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

The submit button for 1st problem ZOZ is not visible on problem page, Is anyone also facing same issue.

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

In partitions problem can we solve it using randomisation. ? is there any other simpler solution for it?

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

I was wondering if anybody was able to solve the last question of Div 1 — Queries on Tree on their own. The editorial cited a research paper. So, I'm guessing it was not a very well known algorithm. Was anybody able to solve the problem on their own in a different way ?

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

    where are the links for the editorials, they are not in the usual place .

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

      Here is it: https://discuss.codechef.com/tags/ltime58/

      Few words about ARRP:

      I can bound teja349's solution as O(N sqrt(N) * checking) using fact about Euler's function. But it's really hard to create test against it. If it's even possible.

      My solution: O(N log N + N log A)

      Let's create partial sums for every prefix, i.e. S[i] = A[1] + ... + A[i]

      Now, when partition for K is possible?

      If exists S[n] * 1 / K, S[n] * 2 / K, .. S[n] * K / K in the set of partial sums.

      What does that mean for S[n] * i / K(i = 1..K) ? It's equivalent S[n] * i / K = S[j] (for some j=1..N) <-> i / K = S[j] / S[n]. A[i] >= 1, hence all the values of S[i] / S[n] are distinct.

      Let's use reverse thinking, if we know the value of X / Y(irreducible fraction) = S[i] / S[n], how to find all values of K where it will be counted? Obviously, it will be counted for values Y, 2*Y, ..., [N/Y]*Y.

      So, now we have the problem with denominators of irreducible fractions. And it sounds like the next one: we have the numbers Y1, ..., YN. We need to find for every K for how many Yi(K % Yi == 0), denote it as cnt[K]. It can be done with some application of Sieve of Eratosphenes. And a partition for K is possible iff cnt[K] == K.

      The complexity is N log A(finding gcd for making the fractions S[i]/S[n] irreducible) and N log N(N + N / 2 + .. + N / N) for Sieve of Eratosphenes.

      Below is my code for ARRP(it's absolutely clear): https://pastebin.com/SUHJvQUt

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

        Thank you for the link and your explanation. I'll look at it.

        This was my favourite LunchTime contest so far. I really liked that there are more problems now that it's unrated.

        What is your opinion about the last problem of Div 1 ? Was it an impossible problem or is it possible for people who did not read that research paper to solve it ?

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

          Glad to hear it!!

          I guess you're asking about another approach. I'm not sure in this approach, probably you can solve it with sqrt-decomposition by queries and for every sqrt(Q) queries compress the tree in O(sqrt(Q)) (nodes+LCA of them)(nodes which will be used in the next O(sqrt(Q)) queries), then you can solve it in O((Q + N) * sqrt(Q) * log(N)) but with huge constant.

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

        I liked how you transformed it to a question of counting irreducible denominators.

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

        Heyy,Thanks

        Actually I dont know what I was thinking while analysing complexity.I just thought that checking was similar to sieve and thought nlogn and(logn) for checking. But after your comment I realise my analysis was wrong.But anyways it seems breaking that solution is not possible.

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

          There is no problem :)

          Tester thought that this approach has complexity O(N log N). Even me at the very beginning. It's quite confusing. The most crucial optimization is check if SUM % i == 0.