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

×

[closed] Doubt in MIKE3

I just want to know why my this submission didn't worked but a recursive brute force worked. Can you give me a case where it fails. Thank you :)

I updated the link. Sorry for the confusion.

asked 18 Mar '14, 15:20

ashish1610's gravatar image

4★ashish1610
4981616
accept rate: 22%

edited 19 Mar '14, 14:17

admin's gravatar image

0★admin ♦♦
19.0k348495531

The question has been closed for the following reason "The question is answered, right answer was accepted" by ashish1610 18 Mar '14, 21:19


@ashish1610 General advice for getting testcases where your code fails. As you have an AC, so I assume that you had a solution which was accepted, now what you can do is generate random test-cases and run both your AC and WA solutions and check where the solutions of both cases don't match. This generally helps me, I dont know if this is a recommended thing or not but it has helped me a lot. In case I dont have AC solution with me, I use brute-force approach if my main aim is to know where it gets wrong.

link

answered 18 Mar '14, 19:30

deepsaggas's gravatar image

4★deepsaggas
50661118
accept rate: 10%

edited 18 Mar '14, 19:31

I got that but I never got the case where it fails. Finally I wrote up the recursive brute force solution for this. Can you please provide me the case. And no my submission answered correct ans for all the cases that I made by my own.

link

answered 18 Mar '14, 15:40

ashish1610's gravatar image

4★ashish1610
4981616
accept rate: 22%

Please check this [Editing test case]

40 16
4 1 4 20 24
2 33 39
4 18 33 35 40
3 12 30 34
4 1 17 31 37
2 12 40
2 34 35
2 5 13
2 7 16
3 17 27 39
3 7 9 10
4 8 18 20 35
2 19 26
1 11
1 30
4 3 9 23 34
link

answered 18 Mar '14, 16:14

mjbpl's gravatar image

5★mjbpl
41927
accept rate: 6%

edited 18 Mar '14, 19:44

I am assuming it is 1 1 rather than 1 1 15 in 2nd line and 2 3 15 rather than 3 3 15

(18 Mar '14, 16:35) ashish16104★

It gave correct ans.

(18 Mar '14, 16:39) ashish16104★

I am sorry Ashish. It seems I made a mistake in understanding your logic.

(18 Mar '14, 17:10) mjbpl5★

100 9 1 1 3 2 1 9 3 3 1 9 3 4 1 9 3 5 1 9 3 6 1 9 5 2 3 4 5 6 2 6 7 2 7 9

(18 Mar '14, 17:18) jangwa2★
2

Found it!!! 40 16 <endl> 4 1 4 20 24 <endl> 2 33 39 <endl> 4 18 33 35 40 <endl> 3 12 30 34 <endl> 4 1 17 31 37 <endl> 2 12 40 <endl> 2 34 35 <endl> 2 5 13 <endl> 2 7 16 <endl> 3 17 27 39 <endl> 3 7 9 10 <endl> 4 8 18 20 35 <endl> 2 19 26 <endl> 1 11 <endl> 1 30 <endl> 4 3 9 23 34 <endl>

Expected 10, your program returns 9.

(18 Mar '14, 17:41) mjbpl5★

Thanks @mjbpl

(18 Mar '14, 17:52) ashish16104★
showing 5 of 6 show all

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×272
×9

question asked: 18 Mar '14, 15:20

question was seen: 900 times

last updated: 19 Mar '14, 14:17