首页 > dd爱科学1.0
头像 狂点技能树
发表于 2021-06-01 16:41:49
思路一: 在保证最长上升子序列的前提下修改数最少:等价于求最长上升子序列长度 #include <bits/stdc++.h> const int N = 1000009; int n; string s; int qu[N], tot; int finding(int x) 展开全文
头像 LavenderPikachu
发表于 2021-06-01 19:20:20
贪心:修改的的位数越小越好 那么n-最长非递减子序列的长度即是最小修改的位数#include<bits stdc++.h>using namespace std;const int N = 1e6+10;int n;int a[N],low[N];#define fast ios::sy 展开全文

等你来战

查看全部