# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
942500 | mannshah1211 | Rabbit Carrot (LMIO19_triusis) | C++17 | 22 ms | 4624 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/**
* author: hashman
* created:
**/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
int lis(const vector<int>& a, int x) {
vector<int> ret;
ret.push_back(x);
for (int i = 0; i < a.size(); i++) {
int it = a[i];
auto pos = lower_bound(ret.begin(), ret.end(), it + 1);
if (pos == ret.end()) {
ret.push_back(it);
} else {
ret[pos - ret.begin()] = it;
}
}
return (int) ret.size();
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<int> foo;
for (int i = 1; i <= n; i++) {
int x;
cin >> x;
foo.push_back((i * m) - x);
}
vector<int> bar;
for (auto it : foo) {
if (it >= 0) bar.push_back(it);
}
cout << n + 1 - lis(bar, 0) << '\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... |