- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
Latest commit
85 lines (82 loc) · 2.29 KB
/
Copy pathtest.cpp
File metadata and controls
85 lines (82 loc) · 2.29 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* @authors Bowen Chen (chenbowen9612@gmail.com)
* @date 2016-10-22
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cctype>
#include<ctime>
#include<cmath>
#include<vector>
#include<map>
#include<climits>
#include<set>
#include<stack>
#include<queue>
#include<sstream>
#include<functional>
usingnamespacestd;
typedef vector<int> VI;
typedef map<string, int> MSI;
typedef map<int, int> MII;
typedef pair<int, int> PII;
typedef set<int> SI;
typedeflonglongLL;
constintINF = 0x3f3f3f3f;
constdouble eps = 1e-9;
#define_ios_base::sync_with_stdio(0);cin.tie(0);
#definebitcount __builtin_popcount
#definegcd __gcd
#defineF(i,n) for(int i=0;i<(n);++i)
#defineFOR(i,x,y) for(int i=(x);i<=(y);++i)
#defineFD(i,n) for(int i=(n-1);i>=0;--i)
#defineFORD(i,y,x) for(int i=(y);i>=(x);--i)
#defineMEM(x,i) memset(x,i,sizeof(x))
#definemp make_pair
#definedb(a) cout<<(a)<<endl
#definewhatis(a) cout<<#a<<" is "<<a<<endl
#definebugprintf("\nhere!!!\n")
#definefi first
#definese second
#definepb push_back
#definesz(a) ((int)(a.size()))
#defines(n) scanf("%d",&(n))
#definesc(n) scanf("%c",&(n))
#definesf(n) scanf("%lf",&(n))
#definess(n) scanf("%s",(n))
#ifdef LOCAL
#defineLLD"%lld"
#else
#defineLLD"%I64d"
#endif
#definesl(n) scanf(LLD,&(n))
constint N = 5002;
constint hashsize = 1000003;
int head[hashsize], next[hashsize];
voidinit_lookup_table() {MEM(head, 0);}
inthash(State& s) {
// 将状态转成整数
// ...
return v%hashsize;
}
booltry_to_insert(int s) {
int h = hash(st[s]);
int u = head[h];
while (u) {
// 判重
if (memcmp(st[u], st[s], sizeof(st[u])) == 0)
returnfalse;
u = next[u];
}
returntrue;
}
intmain() {
#ifdef LOCAL
freopen("in", "r", stdin);
// freopen("out", "w", stdout);
#endif
return0;
}