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

Function calch

code/graph/idastar.cpp:2–5  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1int n, cur[100], pos;
2int calch() {
3 int h = 0;
4 rep(i,0,n) if (cur[i] != 0) h += abs(i - cur[i]);
5 return h; }
6int dfs(int d, int g, int prev) {
7 int h = calch();
8 if (g + h > d) return g + h;

Callers 2

dfsFunction · 0.85
idastarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected