# LIS(最长上升子序列)

## part one

```#include <cstdio>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <iostream>
#include <queue>
#include <stack>
#include <bitset>
#include <map>
using namespace std;
template <typename _TP> inline void read(_TP &x){
x = 0;int f = 1;char c = getchar();
for(;c < '0' || '9' < c; c = getchar()) if(c == '-') f = -1;
for(;'0' <= c && c <= '9'; c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
x *= f;return;
}
template <typename _TP> inline void print(_TP x){
if(x < 0) putchar('-'),x = -x;
if(x > 9) print(x / 10);
putchar(x % 10 + 48);
return;
}
#define rg register
#define ll long long
#define print_n(a) print(a),puts("")
#define print_(a) print(a),putchar(' ')
#define lowbit(k) (k & -k)
const int inf = 2147483647;
const int maxn = 2e5 + 7;
int n,cnt;
int a[maxn],c[maxn];
struct data{int id,val;}d[maxn];
inline bool cmp(data A,data B){
if(A.val == B.val) return A.id > B.id;
return A.val < B.val;
}
inline int query(int k){
int Ans = 0;
for(;k; k -= lowbit(k)) Ans = max(Ans,c[k]);
return Ans;
}
for(;k <= n; k += lowbit(k)) c[k] = max(c[k],y);
return;
}
int main()
{