#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#define ll long long
using namespace std;
bool cmp(ll a, ll b)
{
return a > b;
}
ll dao[100000] = { 50000 };
ll sum[100000];
int main()
{
ll s, tt = 1;
ll tt2 = 0;
while (~scanf("%lld", &s))
{
ll wei = lower_bound(dao, dao + tt, s) - dao;
if (wei == tt)
{
dao[tt] = 50000, tt++;
}
dao[wei] = s;
wei = upper_bound(sum, sum + tt2, s, cmp) - sum;
if (wei == tt2)tt2++;
sum[wei] = s;
}
printf("%lld\n%lld\n", tt2, tt);
system("pause");
return 0;
}
让人春分日 哈工科教104318.导弹拦截Ⅰ
最新推荐文章于 2024-07-18 17:40:16 发布