{ // 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. // Example: // "Print to console": { // "prefix": "log", // "body": [ // "console.log('$1');", // "$2" // ], // "description": "Log output to console" // } "basic": { "prefix": "basic", "body": [ "#include <bits/stdc++.h>\nusing namespace std;\ntypedef long long ll;", "typedef pair<int, int> pii;\nconst int MOD = 1e9 + 7; // 998244353;", "const int INF = 2e9; // const ll INF = 4e18", "int main()\n{\n $0// freopen(\"${1:filename}.in\", \"r\", stdin);", " // freopen(\"${1:filename}.out\", \"w\", stdout);\n // ios::sync_with_stdio(0);", " // cin.tie(0);\n ;\n return 0;\n}" ], "description": "basic", "isFileTemplate": true }, "Complex": { "prefix": "Complex", "body": [ "struct Complex {", " double Re, Im;", "};", "Complex operator+(const Complex &A, const Complex &B) {return Complex{A.Re + B.Re, A.Im + B.Im};}", "Complex operator-(const Complex &A, const Complex &B) {return Complex{A.Re - B.Re, A.Im - B.Im};}", "Complex operator*(const Complex &A, const Complex &B) {return Complex{A.Re*B.Re-A.Im*B.Im, A.Re*B.Im+A.Im*B.Re};}", "$0" ], "description": "Complex number class, supports +,-, and *", }, "Info": { "description": "info of the file such as author, time, etc.", "prefix": "info", "body": [ "/**", " * @author: peter_code", " * @date: ${1:date}", " * @brief: ${2:brief}", "*/", "$0" ] }, "LSQXX": { "description": "LSQXX", "prefix": "lsqxx", "body": [ "struct Edge {", " int v, nxt;", "} e[$1 << 1];", "int head[N], tot;", "void add_edge(int u, int v) {", " ++tot;", " e[tot] = Edge{v, head[u]};", " head[u] = tot;", "}", ], }, }
Note.ms
/petercodessnippet