//Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and 
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
// same ids are connected.
// prefix 的格式要求是 acm-[一级标题编号].[二级标题编号][该代码片段的英文简称]
// description 的格式要求是 "插入 [该代码片段的中文名]"

{
    "求凸包面积": {
        "prefix": "acm-8.1tubao",
        "body": [
            "// 传入多边形的顶点数组 p（不要求首尾点重合，只要是顺时针或逆时针按顺序排列即可）",
            "// 返回多边形的面积",
            "double polygon_area(const vector<Point>& p) {",
            "    int n = p.size();",
            "    if (n < 3) return 0.0; ",
            "    double sum = 0;",
            "    for (int i = 0; i < n; i++) {",
            "        sum += cross(p[i], p[(i + 1) % n]); ",
            "    }",
            "    return abs(sum) / 2.0; ",
            "}"
        ],
        "description": "插入 求凸包面积"
    }
}