2863
bzoj #2863. 愤怒的元首
bzoj #2863 设 \(dp_i\) 表示 \(i\) 个点的 DAG 个数。发现一个 DAG 删去出度为 \(0\) 的点后显然还是一个 DAG ,因此不妨枚举出度为 \(0\) 的点的个数: \(dp_i = \sum\limits_{j=1}^i dp_{i-j}\binom{i}{j} ......
[LeetCode] 2863. Maximum Length of Semi-Decreasing Subarrays_Medium tag: stack
You are given an integer array nums. Return the length of the longest semi-decreasing subarray of nums, and 0 if there are no such subarrays. A subarr ......