MCPcopy Index your code
hub / github.com/algorithmzuo/algorithm-journey / update

Method update

src/class131/Code03_CornField.java:34–40  ·  view source on GitHub ↗
(int x, int y, int v)

Source from the content-addressed store, hash-verified

32 public static int n, k;
33
34 public static void update(int x, int y, int v) {
35 for (int i = x; i <= MAXH; i += i & -i) {
36 for (int j = y; j <= k + 1; j += j & -j) {
37 tree[i][j] = Math.max(tree[i][j], v);
38 }
39 }
40 }
41
42 public static int max(int x, int y) {
43 int ans = 0;

Callers 1

computeMethod · 0.95

Calls 1

maxMethod · 0.45

Tested by

no test coverage detected