Cod sursa(job #2087544)
Utilizator | Data | 13 decembrie 2017 20:16:56 | |
---|---|---|---|
Problema | Subsir crescator maximal | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include <fstream>
using namespace std;
ifstream f("scmax.in");
ofstream g("scmax.out");
int v[100005], s[100005], lu[100005], t[100005], n, lmax, i, j, m;
int main()
{
f>>n;
for(i=0;i<n;i++)
{
f>>v[i];
j=1;
while (s[j]<v[i]&&j<=lmax)
j++;
s[j]=v[i];
lu[i]=j;
if (j>lmax)
lmax=j;
}
g<<lmax<<'\n';
return 0;
}