# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
521303 | sicho_mohit | Rabbit Carrot (LMIO19_triusis) | C++14 | 1 ms | 332 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 ll long long
#define pb push_back
#define ff first
#define ss second
using namespace std ;
const int N=1e5;
int main ()
{
// find lis of all valid buildings and subtract it from the total buildings ,
// the left over buildings would be the buildings which would be changed
// or we can say we have to minimse the buildings which needs to be changed ,
// so why not maximise the buildings that do not need to be changed and subtract them
// from the total buildings
ll n , m ;
cin >> n >> m ;
ll arr[n+1];
bool is[n+1];
memset(is,true,sizeof(is));
for (int i=1;i<=n;i++)
{
cin >> arr[i];
if(arr[i]>i*m)
is[i]=false;
}
arr[0]=0;
vector<pair<ll,ll>>lis;
for (ll i=1;i<=n;i++)
{
if(is[i])
# | 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... |