Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 브루트포스
- DFS
- 백준
- BFS
- 누적 합
- 유니티
- 그리디 알고리즘
- c++
- 우선순위 큐
- XR Interaction Toolkit
- 재귀
- 스택
- 자료구조
- 그래프
- 수학
- 문자열
- Team Fortress 2
- 구현
- 다익스트라
- 투 포인터
- 다이나믹 프로그래밍
- 알고리즘
- VR
- 시뮬레이션
- 정렬
- 백트래킹
- Unreal Engine 5
- ue5
- 유니온 파인드
- 트리
Archives
- Today
- Total
목록생일 선물 C++ (1)
1일1알

가격을 기준으로 내림차순으로 정렬한 뒤 투 포인터를 이용해 가격의 차이가 D 이상이면 왼쪽 포인터를 늘리고 아니라면 오른쪽 포인터를 늘리는 방식으로 문제를 해결하였다. #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; bool compare(const pair& lhs, const pair& rhs) { return lhs.first > rhs.first; } int main() { ios_base::sync_with_stdio(false); cin.tie..
알고리즘
2022. 3. 6. 11:00