답안 #482493

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
482493 2021-10-25T00:48:47 Z Deepesson Rabbit Carrot (LMIO19_triusis) C++17
0 / 100
0 ms 204 KB
#include <bits/stdc++.h>

int main()
{
    int N,M;
    std::cin>>N>>M;
    std::vector<int> vec;
    int alturas[N];
    for(int i=0;i!=N;++i){
        int h;
        std::cin>>h;
        alturas[i]=h;
        vec.push_back(h-(M*i));
    }
    std::reverse(vec.begin(),vec.end());
    std::vector<int> veco;
    for(int i=0;i!=N;++i){
        if(((N-i)-1)*M<alturas[i])continue;
        int x = vec[i];
        auto it = std::upper_bound(veco.begin(),veco.end(),x);
        if(it!=veco.end()){
            *it=x;
        }else veco.push_back(x);
    }
    std::cout<<(N-veco.size())<<"\n";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -