Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boolean isOneLine(int p, int p1, int p2, int[][] points){
- int x = points[p][0];
- int y = points[p][1];
- int x1 = points[p1][0];
- int y1 = points[p1][1];
- int x2 = points[p2][0];
- int y2 = points[p2][1];
- long r = (y - y1)*(x2 - x1);
- long l = (y2 - y1)*(x - x1);
- return r == l;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement