Skip to content

Commit 5a97bac

Browse files
committed
Improved 3161
1 parent 5c9af3d commit 5a97bac

File tree

1 file changed

+6
-1
lines changed
  • src/main/java/g3101_3200/s3161_block_placement_queries

1 file changed

+6
-1
lines changed

src/main/java/g3101_3200/s3161_block_placement_queries/Solution.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public List<Boolean> getResults(int[][] queries) {
3737
left.parent[j] = pos[size - 1];
3838
right.parent[j] = max;
3939
}
40+
return List.of(getBooleans(queries, m, size, left, right, bit));
41+
}
42+
43+
private Boolean[] getBooleans(
44+
int[][] queries, int m, int size, UnionFind left, UnionFind right, BIT bit) {
4045
Boolean[] ans = new Boolean[m - size + 1];
4146
int index = ans.length - 1;
4247
for (int i = m - 1; i >= 0; i--) {
@@ -53,7 +58,7 @@ public List<Boolean> getResults(int[][] queries) {
5358
ans[index--] = maxGap >= q[2];
5459
}
5560
}
56-
return List.of(ans);
61+
return ans;
5762
}
5863

5964
private static final class BIT {

0 commit comments

Comments
 (0)