Utkarsh.25dec's blog

By Utkarsh.25dec, 2 years ago, In English

We invite you to participate in CodeChef’s Starters 41, this Wednesday, 1st June, rated for Div 2, 3 & 4 Coders.

Time: 8 PM — 11:00 PM IST

Joining us on the problem setting panel are:

Announcing Scholarship for CodeChef Certification in Data Structure & Algorithms — More than 100 Indian participants in Divisions 1, 2, and 3 will win scholarships for the CodeChef Certification exam (discounted prices). Scholarship criteria can be found on the respective contest pages.

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.

Also, if you have some original and engaging problem ideas and are interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating. Good Luck!

  • Vote: I like it
  • +26
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Why is it downvoted?

»
2 years ago, # |
  Vote: I like it +3 Vote: I do not like it

You will love the contest theme and feel proud after solving questions.

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

It looks like you forgot to add link to the contest page.

»
2 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Also, are non-student participants eligible to win LinkedIn Premium Subscription?

»
2 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Codechef being codechef again :)

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

internal error!!

»
2 years ago, # |
  Vote: I like it +14 Vote: I do not like it

Some things never change :)

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

again same problem,something never change

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Here we go again...

»
2 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it

To Codechef, Beta tumse na ho payega!

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

useless codechef

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

500 we meet again

»
2 years ago, # |
  Vote: I like it +10 Vote: I do not like it

Why CodeChef wastes our time. I think if CodeChef is not prepared they should not organize the contest.

»
2 years ago, # |
  Vote: I like it +11 Vote: I do not like it

What a colossal waste of everyone's time!

»
2 years ago, # |
  Vote: I like it -8 Vote: I do not like it

Site should be normal in 1-2 minutes now. Please continue solving the problems. Contest is STILL RATED.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    How to solve problems, without reading the problems ;-;

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    And how will we solve the problems when the only thing that`s appearing on the screen is 502 Internal Error?

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +28 Vote: I do not like it

    One day cf will be down too and there will be no place for you to post such messages <(`^´)>

»
2 years ago, # |
  Vote: I like it +7 Vote: I do not like it

Must go unrated now though I don't care about anyways

»
2 years ago, # |
  Vote: I like it -20 Vote: I do not like it

I think the site is back now. Please reply if anyone is still facing issues.

»
2 years ago, # |
  Vote: I like it -14 Vote: I do not like it

Just as an update. Contest is still rated. Please do not leave the contest. Problems are very nice (According to me)

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Do we have to solve those extra Div2 and Div3 problems as well to be eligible for a LinkedIn premium subscription?

»
2 years ago, # |
Rev. 2   Vote: I like it +9 Vote: I do not like it

Will Div 1 participants also get the LinkedIn premium subscription? Utkarsh.25dec

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    The announcement says 'per division' so ig div1 is eligible too... Also, it would be stupid if they ignore div1 and give prizes to div2,3,4

    • »
      »
      »
      2 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Yeah, it would be stupid.

      The contest was unrated for Div 1 that's why I wanted to confirm.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +20 Vote: I do not like it

    Yeah definitely

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Problem Link: https://www.codechef.com/START41A/problems/DEARRANGE
Can someone help me in finding the test case in which it's giving the wrong answer: https://ideone.com/l1NRA8
I did a stress test as well, but could not find any test case on which it's failing.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    1 3 3 2 1

    Your code doesn't change position of the 1 after the first operation. This is indeed the only edge case (gave some hard time to my random shuffle solution also).

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there any Codechef rating predictor?

»
2 years ago, # |
  Vote: I like it +8 Vote: I do not like it

An alternative approach to the problem : https://www.codechef.com/START41A/problems/DEARRANGE

Read the editorial's solution for the test cases in which the answer will be $$$0$$$ or $$$1$$$ and also one edge test case.
Now, for case when $$$ans=2$$$ :

Rotate the array by $$$1$$$, $$$n$$$ times and check whether the current rotated array is valid or not each time. (Valid array: If it does not match with any index of the given array and also with the sorted array).
Now, there may be a possibility that none of the rotated arrays is valid. Think of the case when will it be possible :)

Spoiler

Submission : https://ideone.com/4S9T4y

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

What will be the estimated codeforces rating of Div-2 problem E(Black and White)?

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I got TLE in Div2 Problem E(Black and white). Here is my solution : https://www.codechef.com/viewsolution/65914374 Can anyone help me to figure out the solution??

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Note, this line memset(dp, -1, sizeof dp);. What it does is sets the complete table in each testcase and even though memset is fast, it is still $$$O(n)$$$ where $$$n$$$ is the number of spots filled. Changing this line to memset(dp, -1, (n+1)*2*2*sizeof(ll)); eliminates the TLE. Here is the accepted submission(link)