| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 892754 | Kodik | Rabbit Carrot (LMIO19_triusis) | C++17 | 0 ms | 348 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>
using namespace std;
typedef long long ll;
typedef long double ld;
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
int main(){
ios_base::sync_with_stdio(false), cin.tie(NULL);
// freopen("cowjog.in", "r", stdin);
// freopen("cowjog.out", "w", stdout);
int pole_num, jump_height;
cin >> pole_num >> jump_height;
vector<int> poles(pole_num);
for(int &i : poles) cin >> i;
vector<int> poss_unchanged;
for(int i = 1; i < pole_num; ++i){
if(i*jump_height >= poles[i-1]){
poss_unchanged.push_back(i*jump_height-poles[i-1]);
}
}
vector<int> ans;
for(int &i : poss_unchanged){
int pos = upper_bound(ans.begin(), ans.end(), i) - ans.begin();
if(pos == ans.size()){
ans.push_back(i);
}else{
ans[pos] = i;
}
}
cout << pole_num - ans.size() << '\n';
return 0;
}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... | ||||
