| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1327328 | hoangtien69 | Rabbit Carrot (LMIO19_triusis) | C++20 | 19 ms | 4180 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 2e5 + 5;
int n, d;
int a[MAXN];
vector<int> peal;
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> d;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
}
for (int i = 1; i <= n; i++)
{
if (i * d >= a[i])
{
int x = i * d - a[i];
int pos = upper_bound(peal.begin(), peal.end(), x) - peal.begin();
if (pos == peal.size())
{
peal.push_back(x);
}
else
{
peal[pos] = x;
}
}
}
cout << n - peal.size();
}
| # | 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... | ||||
