×

# Editorial for GARGOYLE - PELT2019

 0 Difficulty: Easy Problem setter: panik Prerequisites: Implementations, usage of maps/dictionary(if in python). Explanation: I this question for statements to not contradict, all the statement arrays of the selected people should be similar. We can do this by taking the count of each distinct array with the help of maps and then Iterating all of them and finding the maximum count with the correct Statements. Note: A statement array will only be considered correct if the count of True in it is equal to the count of that type of substring. This could be seen in sample Test case 2. Although the count of T T T was 2, the final answer was 1 because according to them all of them were true speaking by according to the 3rd person, he only considered himself to be a true speaking person. Time complexity: O(nlog(n)) -> log(n) factor occurs due to usage of maps. Author's Solution: click here Tester's Solution: click here asked 11 Jan, 18:04 5★panik 116●6 accept rate: 7%

 0 @panik can you please tell me why my code is wrong ? I did exactly same what is mentioned in the editorial, and repeatedly got WA during the contest. link answered 11 Jan, 18:51 107●8 accept rate: 0%
 0 Can anyone help me why my submission is getting wrong answer? I am doing same thing as mentioned above. Link answered 11 Jan, 19:11 12●3 accept rate: 0% @parth_patel15 You've added a link of the submission page. Add the link to the submitted solution. (11 Jan, 19:14) Updated. My solution is same as yours. Don't know why it gets WA. (11 Jan, 19:24) Similar thing happened in Sept 2018 Lunchtime as well where the solution got WA during the contest but got AC in practice section. At that time as well, there was no reply from the admin or the author and the contest was kept as rated. (11 Jan, 20:53) Hi parth, your solution is wrong because you have set ans=1 but ans can be 0 as well (12 Jan, 01:04) panik5★
 0 @panik @admin @vijju123 Kindly check, the tester's solution is even getting a WA LINK answered 11 Jan, 21:04 107●8 accept rate: 0% Hi arjit, I am looking into your solution although its giving the correct ans on codechef compiler on the TC on which your solution is showing wrong, i am looking into it. @vijju123 can you please have a look (12 Jan, 01:06) panik5★ Sorry wrong tester solution file was attached, the file is updated, please have a look (12 Jan, 01:23) panik5★ @panik Let me know once you find the mistake :) (12 Jan, 10:53) @panik Did you find the mistake ? (13 Jan, 17:03) @panik @admin @vijju123 anyone could you please bother to reply? (yesterday)
 0 @panik Can you please explain the output for the Sample Case 2 in a litle more detailed way? Still not able to get it. answered 12 Jan, 02:45 0●1 accept rate: 0% see the first 2 people consider everyone to be a truth speaking person, but the 3rd person doesn't think so, so we cannot cosider to T T T statement to be correct. No if we pick the F F T statement then according to him only the 3rd person is correct and this does not contradict with any statement as only 1 person is in set and the count of T in statement is 1 also, so ans is 1 (12 Jan, 11:54) panik5★
 0 I do not understand how is the time complexity of the suggested solution nlogn. I think that the time complexity of the solution is (n^2)logn. Can you please explain? answered 1 hour ago 71●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:

×3,703
×10
×8
×6
×2