MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / solve

Method solve

code/other/dpll.cpp:44–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 log.pop_back(); }
43 return assume(x^1) && bt(); }
44 bool solve() {
45 val.assign(2*n+1, false);
46 w.assign(2*n+1, vi()); loc.assign(2*n+1, vi());
47 rep(i,0,head.size()) {
48 if (head[i] == tail[i]+2) return false;
49 rep(at,head[i],tail[i]+2) loc[cl[at]].push_back(i); }
50 rep(i,0,head.size()) if (head[i] < tail[i]+1) rep(t,0,2)
51 w[cl[tail[i]+t]].push_back(i);
52 rep(i,0,head.size()) if (head[i] == tail[i]+1)
53 if (!assume(cl[head[i]])) return false;
54 return bt(); }
55 bool get_value(int x) { return val[IDX(x)]; } };
56// vim: cc=60 ts=2 sts=2 sw=2:

Callers 1

testFunction · 0.80

Calls 2

push_backMethod · 0.80
sizeMethod · 0.45

Tested by 1

testFunction · 0.64