| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1360038 | biserailieva | Bouquet (EGOI24_bouquet) | C++20 | 14 ms | 2628 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<pair<int,int>> seg;
for(int i = 0; i < n; i++)
{
int l, r;
cin >> l >> r;
l = min(l, i);
r = min(r, n - i - 1);
int L = i - l;
int R = i + r;
seg.push_back({L, R});
}
sort(seg.begin(), seg.end(), [](auto a, auto b){
return a.second < b.second;
});
int last = -1;
int ans = 0;
for(auto [L, R] : seg)
{
if(L > last)
{
ans++;
last = R;
}
}
cout << ans << "\n";
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
