You are not logged in. Please login at to post your questions!


Codechef SnackDown 2019 Question #1

I'm newbie to competitive programming, so tried to solve this question, I've write my solution, and also verified my code on custom inputs, they all worked for me.

But while submitted my solution it's giving me 'Wrong Answer', which mean I know my code has failed with some test cases, But the problem is I coudn't find any wrong with my solution, Can someone please point out that? Which will help me to learn more.

Here is my Solution :

asked 16 Oct '18, 22:38

hacktushar's gravatar image

accept rate: 0%

Here's an input for which your code fails

10 2
1 9 6 3 6 6 2 9 2 3

Expected Output: 2

Your Output: 5 (link)


answered 16 Oct '18, 22:47

aditya95sriram's gravatar image

accept rate: 20%

Why It's 2, I think after sorting input 9,9,6,6,6,3,3,2,2,1 and here K=2 means # of teams which has 2nd rank, so it's 9,9,6,6,6 and this is total = 5

Can you explain why it's 2?

(17 Oct '18, 01:04) hacktushar2★

Team #1: 9 Team #2: 9 That's all.

(17 Oct '18, 02:14) afaxnraner6★

Ohhh my bad, I got understand question in slight wrong way. However I've not passed any question in this Qualifier Round, So Am I out of this SnackDown 2019 or have chance for another next "SnackDown 2019 - Online Round 1A" ?

(17 Oct '18, 12:42) hacktushar2★

The qualification criteria was to solve at least one question, if you didn't manage to solve any questions then I'm afraid you are out of SnackDown 2019. That's okay, when you are just beginning competitive programming, such things happen.

(18 Oct '18, 01:37) aditya95sriram4★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 16 Oct '18, 22:38

question was seen: 508 times

last updated: 18 Oct '18, 01:37