From f0ee2f9bec953bfe5ac9605b97aaa20715c3ba85 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sun, 14 Aug 2016 17:21:28 +0800 Subject: [PATCH] Create 5842.cpp --- HDOJ/5842.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 HDOJ/5842.cpp diff --git a/HDOJ/5842.cpp b/HDOJ/5842.cpp new file mode 100644 index 0000000..527f8d4 --- /dev/null +++ b/HDOJ/5842.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +using namespace std; +#define N 199999 +char b[N]; +char a[N]; +int LIS( int n) { + int len = 1; b[0] = a[0]; + for (int i = 1; i < n; i++) { + b[a[i] > b[len - 1] ? len++ : lower_bound(b, b + len, a[i]) - b] = a[i]; //·Ç½µ»»Îª>=ºÍupper_bound + } + return len; +} +int main() +{ + int t; + scanf("%d%*c",&t); + for(int test=0;test