-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcpp.json
56 lines (52 loc) · 1.6 KB
/
cpp.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
// 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
// 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.
"Default cpp formate": {
"prefix": [
"include"
],
"body": [
"#include <bits/stdc++.h>",
"#define ll long long",
"#define ull unsigned long long",
"#define lld long double",
"#define w(x) ll x;cin>>x;while(x--)",
"#define all(x) x.begin(), x.end()",
"#define mod 1000000007",
"#define pi 3.141592653589",
"#define speed ios_base::sync_with_stdio(false), cin.tie(nullptr)",
"using namespace std;",
"\n",
"int main(){",
" speed;",
" $0",
" return 0;",
"}",
"",
],
"description": "This is a C++ snippet",
},
"My Custom hash":{
"prefix": "my_hash",
"body": [
"struct custom_hash {",
" static uint64_t splitmix64(uint64_t x) {",
" x += 0x9e3779b97f4a7c15;",
" x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;",
" x = (x ^ (x >> 27)) * 0x94d049bb133111eb;",
" return x ^ (x >> 31);",
" }",
" size_t operator()(uint64_t x) const {",
" static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();",
" return splitmix64(x + FIXED_RANDOM);",
" }",
"};",
],
"description": "Avoid collisions in Hash map",
},
}