| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360037 | biserailieva | Bouquet (EGOI24_bouquet) | C++20 | 48 ms | 1980 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> l(n), r(n);
for(int i = 0; i < n; i++)
{
cin >> l[i] >> r[i];
}
vector<bool> used(n, false);
int ans = 0;
for(int i = 0; i < n; i++)
{
if(used[i])
{
continue;
}
ans++;
int L = max(0, i - l[i]);
int R = min(n - 1, i + r[i]);
for(int j = L; j <= R; j++)
{
used[j] = true;
}
}
cout << ans << "\n";
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
