| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1184666 | peteza | Rabbit Carrot (LMIO19_triusis) | C++20 | 1 ms | 328 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int pcnt = 0;
ll n, j, x;
int main() {
cin.tie(0) -> sync_with_stdio(0);
cin >> n >> j;
deque<ll> deq(1, 0);
for(int i=1;i<=n;i++) {
cin >> x;
x -= i*j;
while(deq.size() > 1 && x > deq.front()) {
deq.pop_front();
pcnt++;
}
if(deq.size() != 1) deq.push_front(x);
else if(x <= deq[0]) deq.push_front(x);
else pcnt++;
}
cout << pcnt;
}| # | 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... | ||||
