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

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

We invite you to participate in CodeChef’s December Lunchtime, this Saturday, 26th December, from 9:30 pm to 12:30 am IST.
Note the unusual time. It starts at 9:30pm instead of the usual 7:30pm

You will be given a total of 8 problems (6 in Div2, 6 in Div1) to solve in a duration of 3 hours.

Joining us on the problem setting panel are:

Problem Submission: If you have original problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Prizes: Top 10 Indian and top 10 Global school students from ranklist will receive certificates and CodeChef laddus, with which they can claim cool CodeChef goodies. Know more here.

The video editorials of the problems will be available on our YouTube Channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Good luck and have fun!

As this is my first contest as CodeChef admin, I wanted to add few words from myself. Please do consider setting problems on CodeChef, we need your help to create great contests! One of the advantages of setting problems on CodeChef is that you don't have to create whole problemset by yourself (though it is certainly possible, you can write directly to admins to contest.admin2@codechef.com for LunchTimes and to contest.admin3@codechef.com for Cook-Offs). Many new authors can't create whole problemset without experience, and that's totally understandable! Sending problems for review allows you to get feedback for our admins (Um_nik, 300iq, jtnydv25, Ashishgup and Morphy), and if your problem is good, you will get the invaluable experience of setting a problem for thousands of participants worldwide while working side-by-side with some of the best minds in competitive programming. Some of the best problems in this contest are set by first-time problemsetters, at least on such a level, and they did a great job, I'm looking forward to working with them again.

Apologies to SeismicToss for messing up the announcement :)

The contest is unrated due to queue and server issues.

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

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

Should we start considering CodeChef as a regular place to compete xd?

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

the queue was long in the cookoff and the contest was lagging so if you could work on it then it would be great.

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

Reminder 1 — Contest starts in 1 hour, 45 minutes.

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

Queue :(

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

submitted b 20 minutes ago still in queue.

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

Judge is too slow .

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

CC Judge..Please stop keep running and take some rest.

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

When you waited 15 mins for your submission and the website shows "unable to connect to codechef server" :(

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

And here goes the queue...

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

its working very slow .

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

My solution for SWAP10HG has been stuck for 40 min now T_T

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

Please declare it unrated now. It (judge servers) has reached the heights of all frustrations now!

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

Anyone facing queues ?

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

Unable to connect to the codechef servers and then you are allowed to make one submission in 120s

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

cc is the internet explorer of the programming websites.

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

I trying to submit a problem for 30 minutes. but codechef do not want to take the solution. xD

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

Ok now you can't deny the fact that it is getting frustrating now. Please make it unrated.

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

The codechef server is not loading. I have been waiting for 25 minutes to submit my code

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

Site loading too slow.

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

Make this shitty contest unrated! Unable to connect to codechef servers

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

Everyone when 300iq didn't make many tests last Codechef:

"Weak tests! Bad problems! So easy to cheese!"

But actually, he was just trying to lessen the load on the queue. Truly a 300 iq move.

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

Codechef is only focusing on their unacademy course.

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

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

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

codechef should do something because there are only two short contest in whole month and issue like this in those contest is very frustrating for all participants.

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

That was not a good way to end the year.

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

Codeforces smoothly handles over 15K participants every contest , to the contrary , cc can't handle even half the load...

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

    I think it is probably because of cf has pretests

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

      CF also has features like hacking phase, announcements for which we get notifications, we can ask our doubts/questions to the problem setters, leaderboard that updates in real time unlike every 1 minute or so and a leaderboard which accounts for people who have 0 correct submissions too. Also CodeForces is non-profit where I have seen only HarbourSpace sponsoring rounds and imho that is fine. CodeChef is blatantly supporting a scammy educational institute and yet still does not want to spend on their servers. They also offer certificates for money which cost a lot. You would think after all this, they would have better servers compared to CF.

      inb4downvotedbyindianfanboys

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

        Why do you think Unacademy is a scammy corporation? Have you EVER been to their youtube channel to see how much free material they have uploaded there? Every corporation that asks for your money isn't scammy. Byju's and WhiteHatJr might be scammy but unacademy is definitely not.

        Also codechef was only recently acquired by Unacademy. They asked Errichto to criticise them and tell them whats wrong. So they surely want to improve. Just give them their time. Its not like Codeforces didn't have any server problems in the past. Also, codechef is also non-profit. They don't tell you to buy their coure. They ASK you. Its completely upto you if you want to buy them. They dont even spam their homepage asking you to buy their courses.

        Call me an Indian Fan boy but I disagreed with your comment and downvoted it :-)

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

Contest Authors just wasted their problems. It would've been nice if this contest was on cf. :'(

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

What a way to end the year, CodeChef!

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

[user:CodeChef_admin,2020-12-26]Does contestant got laddus in an Unrated contest in codechef? Anyone knows about that? CodeChef_admin

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

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

ahh, it was a cool problemset :'(. First atcoder doesn't allow to participate now this happens :/

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

I really feel sad for problem setters , there were so nice problems , queue ruined their efforts

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

you should give us more time and solve the server issue.Not making this contest unrated will solve the problem

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

Stop spreading hate so much for CC, Don't forget what they have done for CP in Past in India.

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

Its very bad to see ppl cussing codechef, there can be problems like these and it happens in codeforces also (maybe less no. of time)... but I hope cc will show the reason officialy.

I am saying this is bad bcz, at first someone pay the authors to create contest for u to participate in and if something wrong happens than its totally their mistake... maybe they had judged it all wrong like no. of ppl and no. of files.

Actually as one of guy in comment was saying above, it more of seems very interesting case of how ur servers can get overwhelmed with these type pf things which no one can think of.

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

Is CodeChef worth giving the contest?? I had my submission queued for 25 mins. XD

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

.

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

Even though contest is unrated, do try Sum of Digits — https://www.codechef.com/LTIME91A/problems/SUMDIGIT. It has been made with a lot of work.

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

Offcourse, we want codechef not queuechef

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

Will we get verdict this year or in 2021?

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

Me after getting WA after 52 minutes in queue- meme

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

how to solve even sequence problem??? any hint.. problems were really awsm....

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

    Try using DP with 2 transitions, first transition is getting 2 equal number, and the second transition is delete the current number (delete a number and insert extra number to get a pair has tha same cost) .

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

"An even sequence has the following property: each maximal contiguous subsequence which contains only equal integers (i.e. the same integer repeated a number of times) has an even length. In particular, the empty sequence is even. A subsequence is maximal if it is not contained in a larger contiguous subsequence which contains only equal integers."

The example says seq "112" is not an even sequence. Why? The definition says it is.

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

    equal digit length should be even in this case length of digit 2 is not even -> "only equal integers (i.e. the same integer repeated a number of times) has an even length"

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

      Each maximal contigous subsequence...

      The 2 is obviusly not maximal.

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

        Yeah it is — it is not contained in any larger contiguous subsequence which contains only 2.

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

          how to solve this problem??

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

            Solution for Even Sequence: Dynamic Programming.

            Main intuition: Deleting elements is beneficial only when you are merging two disjoint subsequences whose elements are equal. To do so, it is beneficial to always pick the nearest such subsequence. Otherwise you can only add elements.

            First of all, condense all maximal contiguous subsequences. Then maintain answers for $$$dp[id][parity]$$$ which is equal to "the minimum cost such that i have processed till index id and all maximal contiguous subsequences are even except the last one, the last one has parity equal to the parity in the state".

            For transitions: You can either choose the immediately maximal contiguous subsequence OR you can choose the nearest previous contiguous subsequence whose elements were equal to the elements of the current contiguous subsequence. (You will have to use some optimizations like prefix sum for full score, also you will have to keep track of the last occurance of each subsequence)

            The answer is obviously — $$$dp[number of subsequences][0]$$$

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

Can anyone explain why is the answer for THREE (Three Letters) equal to $$$\displaystyle \text{min}\Big( \sum_{c \in A} \Big \lfloor \frac{f_c}{2} \Big \rfloor, \frac{|S|}{3}\Big)$$$ ?

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

    you can create a palindrome using only two ways.

    1st three same characters and 2nd 2 same characters and one different. So maximum number of palindrome of size 3 we can create is ∑c∈A⌊fc2⌋. Also it can't exceed size of string/3 so take minimum.

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

      Thank you for replying.

      I understand that these two things give two different upper-bounds on the answer, but can you prove why is the answer exactly the minimum of those? (i.e. why can't the answer be any other value that is lesser than those two things?)

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

        Can any of the admins comment on that, please? I am still unclear of the proof of the formula. Um_nik, Ashishgup

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

        Assume, you have an array of length n and there are x (x <= floor(n/3)) pair of numbers such that both of them are equal, you'll always have x numbers to insert between them to make them 3-length palindrome.

        Example 1:
        Example 2:

        So basically, you can never run out of the number of elements to insert between such pairs if x <= floor(n/3).

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

I wrote a greedy solution to even sequence solution link

Can anyone tell me any case of failure.

My rough approach is to maintain a set of all odd length numbers we got. If the next sequence is of even length and that number is already present in set than remove all other element and add to answer and only keep that element else just remove all the element from set and add to answer.

If sequence is of odd length then add only to if it's length if of 1 and if it's already present than add to answer size of set — 1 and clear it.

P.S. — I got AC but still asking because everyone wrote DP, So greedy maybe wrong.

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

If any one is stuck at even Sequence can watch this- https://youtu.be/EoQhlHe6PYA

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

Problem : K-Tuple Tree [Inclusion-Exclusion]

Did anyone try solving it using inclusion-exclusion principle? The idea is to first break the graph into different component by removing nodes labeled with 0 color. And then to calculate inverse, i.e total ways such the condition does not satisfy, i.e there are ATLEAST two nodes belonging to same component. Subtract above from total ways of assigning and you get the answer.

I was able to pass 4 subtasks but got WA on rest (for k > 3 I guess). I think there might be something wrong with my formulation of inclusion-exclusion. Can someone please help me with the solution?

Problem link : https://www.codechef.com/LTIME91A/problems/KTTREE

Solution link : https://www.codechef.com/viewsolution/40859580

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

Can anyone tell me what's the answer for problem Three Letters for case:

1 xxxyyyabc

To me it seems answer should be 2 but my code shows 3 & i got AC !!

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

Do you guys have any idea about this DIV-3 thing on codechef?