# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
609431 | alexz1205 | Rabbit Carrot (LMIO19_triusis) | C++14 | 0 ms | 212 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int nums[n];
for (int x = 0; x < n; x ++){
int a;
cin >> a;
nums[x] = m * (x+1) + a;
}
vector<int> seq;
for (int x = 0; x < n; x ++){
int i = lower_bound(seq.begin(), seq.end(), nums[x]) - seq.end();
if (i == seq.size()){
seq.push_back(nums[x]);
}else {
seq[i] = nums[x];
}
}
cout << seq.size() << endl;
return 0;
}
Compilation message (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... |