G
G. Two Merged Sequences
题意 和C题差不多 但是是在一个严格上升的序列中插入严格递减的序列
做法 我们按照贪心 定义一个inc 代表当前上升序列最大值 Dec 当前下降序列最小值
如果你这个值可以既放上升序列 下降序列 那么我们特判一下下一个是否比当前这个大 如果大那么这个可以当上升
否则我就让他当下降 例如这组数据
6
1 2 50 3 51 5
当到50的时候 如果3比50大那么让50当下降序列 否则让50当上升序列
贪心的去完成即可
/*
if you can't see the repay
Why not just work step by step
rubbish is relaxed
to ljq
*/
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <cmath>
#include <map>
#include <stack>
#include <set>
#include <sstream>
#include <vector>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define dbg2(x1,x2) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<endl
#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<" "<<#x3<<" = "<<x3<<endl
#define