×

# KCOMPRESS Last TC

 0 Here is link of my solution to KCOMPRESS " https://www.codechef.com/viewsolution/19705500 ". I am somewhere stucked with the last test case. Can someone find the testcase against which my code is not working ? asked 13 Aug '18, 18:16 201●5 accept rate: 0%

 0 Try a test case like [4,4,4,3,4,4,4]. The punch line of this test case was, if there are same elements $A_i$ which are not adjacent, but within a difference of $k$ indexes, the $B_i$ assigned to them must be same. answered 13 Aug '18, 19:36 15.2k●1●18●60 accept rate: 18% exactly !!! (13 Aug '18, 20:35) 1 https://www.codechef.com/viewsolution/19658864 my soln... Prob is in cases where there are similar numbers in range.... (13 Aug '18, 20:40)
 0 I disagree with @vijju123 here. e.g. - $K = 3$ $A$ = $[1,1,1,8,1,1,1,1,9,1,1,2,3,8,3,2,1]$ $B$ = $[1,1,1,2,1,1,1,1,3,1,1,2,3,4,3,2,1]$ The punch line of this test case was, if there are same elements Ai not within a difference of k indexes, the Bi assigned to them may not be same. answered 13 Aug '18, 20:41 2.3k●1●5●16 accept rate: 10% 1 if there are same elements Ai not within a difference of k indexes Isnt this kind of obvious? How does this anyway disprove what I said? I mentioned a case when same elements lie within $k$ indices and your case is completely something else. We need to be on same platform to "disagree" or agree xD (13 Aug '18, 21:48) It isn't obvious. I wasted 2 days due to this. I tried with difference of 2*k earlier. And more test cases failed. Everytime I tried this I had to drop this idea. Finally used k to get AC. (14 Aug '18, 01:45)
 0 Your code fails for test case 5 9 7 2 9 9 8 Expected Output : 2 Your Output : 3 answered 13 Aug '18, 21:54 96●6 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×2,701
×398

question asked: 13 Aug '18, 18:16

question was seen: 345 times

last updated: 13 Aug '18, 21:54