大水题
唉唉唉,,又写了道水题,有点内疚啊,浪费时间啊
LIS ---- nlogn 写法
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <ctype.h>
#include <vector>
#include <algorithm>
#include <sstream>
#define PI acos(-1.0)
#define in freopen("in.txt", "r", stdin)
#define out freopen("out.txt", "w", stdout)
using namespace std;
typedef long long ll;
const int maxn = 100 + 7, INF = 0x3f3f3f3f;
int a[maxn];
char s[maxn];
int b[maxn];
int main() {
scanf("%s", s);
int len = strlen(s);
for(int i = 0; i < len; ++i)
a[i] = s[i] - 'a' + 1;
memset(b, INF, sizeof b);
for(int i = 0; i < len; ++i) {
*lower_bound(b, b+len, a[i]) = a[i];
}
int ans = lower_bound(b, b+len, INF) - b;
cout << 26 - ans << endl;
return 0;
}