int n=4;
vector<int> arr={1,2,3,4,4,4,4,4,5,6,7};
cout << lower_bound(arr.begin(),arr.end(),n)-arr.begin();
3
lower_bound는 구간 내 어떤 를 만족시키는 의 위치 중 제일 왼쪽을 리턴한다.
int n=5;
vector<int> arr={1,2,3,4,4,4,4,4,5,6,7};
cout << lower_bound(arr.begin(),arr.end(),n)-arr.begin();
7
int n=4;
vector<int> arr={1,2,3,4,4,4,4,5,5,5,5,5,6,7};
upper_bound(arr.begin(),arr.end(),n);
7
upper_bound는 구간 내 어떤 를 만족시키는 의 위치 중 제일 왼쪽을 리턴한다.
안녕하세요~웹사이트 솔루션이대해 조언을 구하고싶은데 ㅠㅠ혹시 실례지만 카톡 thegood12 한통주실수있나요~ 광고그런거아니에용~ㅠㅠ정말공부하는데 부족해서 물어보고싶어서 ㅠㅠ그래용