| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 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";
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
