链接:https://ac.nowcoder.com/acm/contest/881/F
来源:牛客网
Solution
官方给的题解是:
。。。。。。。。
附网络一位牛人写的题解
转自:https://www.cnblogs.com/WAautomaton/p/11211864.html
写的很好,不过。。
应该是22倍面积吧。。
步骤中三角形ABC的面积应该是12hl
/*
* Copyright (c) 2019 Ng Kimbing, HNU, All rights reserved. May not be used, modified, or copied without permission.
* @Author: Ng Kimbing, HNU.
* @LastModified:2019-07-18 T 20:34:52.501 +08:00
*/
package NowCoder;
import static ACMProblems.ACMIO.*;
public class RandomPoint {
static class Point {
long x;
long y;
Point(long x, long y) {
this.x = x;
this.y = y;
}
}
private static long cross(Point a, Point b, Point c) {
return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
public static void main(String[] args) {
setStream(System.in);
try {
while (true) {
Point p1 = new Point(nextInt(), nextInt());
Point p2 = new Point(nextInt(), nextInt());
Point p3 = new Point(nextInt(), nextInt());
out.println(11L * Math.abs(cross(p1, p2, p3)));
out.flush();
}
} catch (Exception ignored) {
}
out.flush();
}
}