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

Method compute

src/class143/Code01_Elevator.java:96–105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94 }
95
96 public static long compute() {
97 dijkstra();
98 long ans = 0;
99 for (int i = 0; i < x; i++) {
100 if (distance[i] <= h) {
101 ans += (h - distance[i]) / x + 1;
102 }
103 }
104 return ans;
105 }
106
107 public static void main(String[] args) throws IOException {
108 Kattio io = new Kattio();

Callers 1

mainMethod · 0.95

Calls 1

dijkstraMethod · 0.95

Tested by

no test coverage detected