# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
847715 | NgTrung2217 | Rabbit Carrot (LMIO19_triusis) | C++14 | 22 ms | 1904 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 <bits/stdc++.h>
#define taskname ""
#define ff first
#define ss second
using namespace std;
using ld = long double;
using ull = unsigned long long;
using ll = long long;
using pll = pair <ll, ll>;
using pii = pair <int, int>;
const char el = '\n';
const char sp = ' ';
const ll oo = 1e9; //1e18;
const ll maxN = 2e5 + 5;
ll n, m;
ll e[maxN], c = 0;
int main ()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
if (fopen(taskname".inp", "r"))
{
freopen(taskname".inp","r",stdin);
freopen(taskname".out","w",stdout);
}
cin >> n >> m;
for (int i = 1;i <= n;++i)
{
ll x;
cin >> x;
if (i * m >= x)
{
x = i * m - x;
int k = upper_bound(e + 1, e + 1 + c, x) - e;
c += k > c;
e[k] = x;
}
}
cout << n - c;
}
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... |