MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / travel

Method travel

src/class129/Code05_RoadTrip.java:185–199  ·  view source on GitHub ↗
(int s, int x)

Source from the content-addressed store, hash-verified

183 public static int a, b;
184
185 public static void travel(int s, int x) {
186 a = 0;
187 b = 0;
188 for (int p = MAXP; p >= 0; p--) {
189 if (stto[s][p] != 0 && x >= stdist[s][p]) {
190 x -= stdist[s][p];
191 a += sta[s][p];
192 b += stb[s][p];
193 s = stto[s][p];
194 }
195 }
196 if (dist2[s] <= x) {
197 a += dist2[s];
198 }
199 }
200
201}

Callers 2

mainMethod · 0.95
bestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected