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

Method max

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

Source from the content-addressed store, hash-verified

40 }
41
42 public static int max(int x, int y) {
43 int ans = 0;
44 for (int i = x; i > 0; i -= i & -i) {
45 for (int j = y; j > 0; j -= j & -j) {
46 ans = Math.max(ans, tree[i][j]);
47 }
48 }
49 return ans;
50 }
51
52 public static void main(String[] args) throws IOException {
53 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

Callers 15

computeMethod · 0.95
prepareMethod · 0.45
prepareMethod · 0.45
addMethod · 0.45
prepareMethod · 0.45
dp1Method · 0.45
dp2Method · 0.45
maxValueMethod · 0.45
mainMethod · 0.45
tarjanMethod · 0.45
mainMethod · 0.45
tarjanMethod · 0.45

Calls

no outgoing calls

Tested by 7

edgeToNodeMethod · 0.36
getDistanceMethod · 0.36
prepareMethod · 0.36
setEdgeMethod · 0.36
computeOnCycleMethod · 0.36
dpOnTreeMethod · 0.36
queryMethod · 0.36