×

# PLANEDIV - getting WA

 0 Hi, I've submitted the solution for the problem PLANEDIV, but am unable to figure out the problem in my code as it is getting rejected. I've created a set object and have stored all the line coefficients in the set. I've also overloaded the < and > operators of the set, such that if there is a repeated line with different a,b and c, it will not be added to the set. Then I use a map to count the maximum number of lines in the set with the same slope. But still getting wrong answer. Any help would be appreciated. Here is the link to my solution: https://ideone.com/sfoJ0T Here is a link for the problem statement: https://www.codechef.com/problems/PLANEDIV Thanks in Advance asked 18 Dec '15, 00:34 2★pranjvas 6●4 accept rate: 0%

 0 There are two mistakes in your code :- 1) Your code doesn't provide correct answer for test cases where N = 1, ex consider the test case :- 1 1 10 20 30 It should provide the answer as 1, but it is providing the answer as 0. 2) You don't take gcd of A,B as well as C. The number by which you have to divide the coefficients is gcd(A,B,C) not just gcd(A,B). answered 20 Dec '15, 07:39 4★ps06756 18●1●2 accept rate: 9%
 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:

×1,914
×319
×174
×160
×67
×61
×5

question asked: 18 Dec '15, 00:34

question was seen: 1,105 times

last updated: 20 Dec '15, 07:41