| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1355888 | yyc000123 | Bouquet (EGOI24_bouquet) | C++20 | 17 ms | 3556 KiB |
#include<bits/stdc++.h>
using namespace std ;
const int N = 2e5+5 ;
int n , l[N] , r[N] , le[N] , ri[N] , lemaxi[N] , rimaxi[N] , maxi ;
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) ;
cin >> n ;
for(int i=0 ; i<n ; i++) cin >> l[i] >> r[i] ;
le[0]=lemaxi[0]=1 ;
for(int i=1 ; i<n ; i++){
if(i-l[i]-1<0) le[i]=1 ;
else le[i]=lemaxi[i-l[i]-1]+1 ;
lemaxi[i]=max(le[i],lemaxi[i-1]) ;
}
maxi=lemaxi[n-1] ;
cout << maxi << '\n' ;
return 0 ;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
