doll专题

[leetcode] 354. Russian Doll Envelopes

Russian Doll Envelopes 描述 You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of on

***Leetcode 354. Russian Doll Envelopes

https://leetcode.com/problems/russian-doll-envelopes/description/ LIS就能过掉 然后暴力O(n^2)的写法 bool cmp_small(pair<int, int> a, pair<int, int>b) {if (a.first == b.first) return a.second > b.second;else

Codeforces Round #593 (Div. 2) D. Alice and the Doll(模拟)

题目链接:https://codeforces.com/contest/1236/problem/D   题目大意:一个n*m的地图,上面有k个障碍物,从1 1出发,问能不能在只能右转且不能经过同一个点的情况下遍历所有不是障碍的点   题目思路:就是个模拟,用set维护每一行 每一列障碍的位置,每次二分得到下一次跳跃的位置,并且不断缩小行动范围,一直到无路可走。然后判断一下走的步数+k+1