摘要:
分治递归,选一个把小于它的都交换到它之前,也就是相当于把自己交换到了应有的位置```#include using namespace std;const int N = 25;int a[10] = { 3,5,8,2,7,1,4,6,9,0 };void quicksort(int l, int ... 阅读全文
摘要:
球同盒同可空盒问题```#include using namespace std;const int N = 25;int dp[N][N];int main() { int t, n, m; scanf("%d", &t); while (t--) { scanf("%d%d", &m, &n)... 阅读全文
摘要:
确定当前已知能匹配到的最长处,看是否要更新最长```#include using namespace std;const int N = 210005;int p[N];char str[N], s[N];int main() { while (~scanf("%s", str)) { int n... 阅读全文
摘要:
二分找位置用小的代替大的- -贪```#include using namespace std;const int N = 40005;int s[N];int main() { int t,n,x; scanf("%d", &t); while (t--) { int top = 0, cnt ... 阅读全文
摘要:
利用最大连续子序列和```#include using namespace std;const int N = 105;int a[N][N];int dp[N];int main() { int n; scanf("%d", &n); for (int i = 1; i = 1; k--) { ... 阅读全文
摘要:
```#include using namespace std;char s1[101], s2[101];int s[205];int main() { scanf("%s%s", s1, s2); int n = strlen(s1); int m = strlen(s2); if (n > m... 阅读全文