力扣1642.可以到达的最远建筑 二分答案 class Solution {public:int furthestBuilding(vector<int>& heights, int bricks, int ladders) {auto check = [&](int mid) -> bool{vector<int> h;for(int i=1;i<=mid;i++){int t = h
这道题卡在如何选择方案。。。我想太复杂了,以下是我卡在如何选择方案的算法 class Solution {int N = 100010, M = N * 2, idx = 0, n; int[] e = new int[M], ne = new int[M], h = new int[N];public void add(int a, int b) {e[idx] = b;ne[idx] =