|
Download benchmarks/Algorithms/longest_increasing_subsequence/problem.md from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 914 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/longest_increasing_subsequence/problem.md
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Algorithms/longest_increasing_subsequence/problem.md
-
curl -L -o problem.md https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/longest_increasing_subsequence/problem.md
914 Bytes
| # LeetCode 300: Longest Increasing Subsequence | |
| ## Abstract model | |
| A subsequence retains the relative order of selected elements but need not be | |
| contiguous. Among all subsequences whose values are strictly increasing, | |
| maximize the number of selected elements. The verification case uses the | |
| $O(n^2)$ DP in which `dp[i]` is the best length ending at index $i$. | |
| ## Problem statement | |
| Given an integer array `nums`, return the length of its longest strictly | |
| increasing subsequence. | |
| ## Constraints | |
| - Original problem: $1 \le n \le 2500$ and $-10^4 \le nums_i \le 10^4$. | |
| - Verification case: $1 \le n \le 10^5$. | |
| The function declares `dp[100000]` locally and uses its first $n$ cells. | |
| Its public inputs are `nums` and `numsSize`; the DP table is described only | |
| by the internal annotations. | |
| ## Source | |
| [LeetCode 300, "Longest Increasing Subsequence"](https://leetcode.com/problems/longest-increasing-subsequence/). | |