Hello @all, I was trying to solve this problem: POINTS. I think Im accounting for all the I/O format specifications and problem statement... However, Im getting WA... Can you help me out? Here's my code:
Thanks in advance, Bruno asked 21 Jan '13, 20:43

bool comp(Point a, Point b) { if(a.x < b.x) return (a.x < b.x); else if(b.x < a.x) return (b.x > a.x); else if(a.x==b.x and a.y > b.y) return (a.y > b.y); else if(a.x==b.x and b.y > a.y) return (b.y > a.y); } This is your new comp function, right ?? Had to really search your submission. Please always give a link to the page where I can see your submitted code. Anyways, If a.x == b.x then if a.y > b.y you return true and a.y < b.y then also you return true . This is wrong. Just write if(a.x!=b.x) return a.x < b.x; return a.y > b.y; answered 21 Jan '13, 21:47

if(a.x < b.x) return (a.x < b.x); else return (b.x > a.x); After these four lines in your comp function other lines are not reachable , because if the condition is true then first return statement will be executed otherwise second return statement will be executed . The checks for cases when x coordinate is equal are hence not part of your comp function . answered 21 Jan '13, 20:49

Thank you very much @vineetpaliwal, I got AC after your correction :D And thank you, @anton for fixing code tags as well :D Thanks, Bruno answered 21 Jan '13, 23:03
