#include <bits/stdc++.h>
int main()
{
int N,T;
std::cin>>N>>T;
int array[N];for(auto&x:array)std::cin>>x;
std::vector<int> pilha;pilha.push_back(0);
for(int i=0;i!=N;++i){
int x=array[i];
auto it=std::upper_bound(pilha.begin(),pilha.end(),x-T);
if(it==pilha.end()){
pilha.push_back(x);
}else *it=x;
}
std::cout<<(pilha.size()-1)<<"\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |