# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
540523 | 2022-03-20T16:32:18 Z | juankipedia | Rabbit Carrot (LMIO19_triusis) | C++14 | 1 ms | 340 KB |
# include <bits/stdc++.h> using namespace std; /*************************************************************************************/ # define endl "\n" # define io_boost std::ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); typedef unsigned long long int ulli; typedef long long int lli; /*************************************JUANKIPEDIA*************************************/ const int MAXN = 200005; int N; lli a[MAXN], J; int len, n; int lis[MAXN]; vector<lli> s; int LIS(){ len = 0; vector<int> l; int lis_len[MAXN], pos; for(int i = 0; i < n; i++){ int j = lower_bound(l.begin(), l.end(), s[i]) - l.begin(); if(j == l.size()) l.push_back(s[i]); else l[j] = s[i]; lis_len[i] = j + 1; if(lis_len[i] > len){ len = lis_len[i]; pos = i; } } return len; } int main(){ io_boost; cin >> N >> J; for(int i = 0; i < N; i++) cin >> a[i]; for(int i = 0; i < N; i++) if((i + 1) * J >= a[i]) s.push_back((i + 1) * J - a[i]); cout << N - LIS() << endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |