# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
700219 | 2023-02-19T01:28:30 Z | LucasLe | Rabbit Carrot (LMIO19_triusis) | C++17 | 1 ms | 212 KB |
#include<bits/stdc++.h> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); //freopen("cowjog.out", "w", stdout); #endif int N, M; cin >> N >> M; vector<int> b; for (int i = 1; i <= N; ++i) { int x; cin >> x; if (x <= M * i) { b.push_back(M * i - x); } } vector<int> lis; for (int x : b) { int pos = upper_bound(lis.begin(), lis.end(), x) - lis.begin(); if (pos == lis.size()) lis.push_back(x); else lis[pos] = x; } cout << N - lis.size(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 1 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 1 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 1 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 1 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |