# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
885523 | MongHwa | Rabbit Carrot (LMIO19_triusis) | C++17 | 22 ms | 6868 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<ll> cand;
for(int i = 1; i <= n; i++)
{
int x;
cin >> x;
if(m*i - x >= 0)
cand.push_back(m*i-x);
}
vector<ll> ans;
for(int i = 0; i < (int)cand.size(); i++)
{
int pos = upper_bound(ans.begin(), ans.end(), cand[i]) - ans.begin();
if(pos == ans.size())
ans.push_back(cand[i]);
else
ans[pos] = cand[i];
}
cout << n-ans.size() << '\n';
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |