×

# November Challenge Chef and Happiness

 1 I've written the code for problem CHHAPPY. It should work fine. It runs under the given time limit but gives wrong answer for 3 out of 4 test cases. Please have a look at this code and lemme know what is the problem with this code... My approach is that I make a structure array which is sorted version of A but with its initial indices attached with it. I also check which indices are present in A and mark them valid. Then I check under result function whether any 2 valid elements of structure are equal or not. Here's link to my code: https://ideone.com/NFMTR9 asked 18 Nov '18, 05:20 21●3 accept rate: 0%

 1 I've found the solution to my problem bool result() { for(int i=0;i
 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
×376
×236
×67
×60
×23
×6

question asked: 18 Nov '18, 05:20

question was seen: 121 times

last updated: 18 Nov '18, 06:19