c언어 2517번 달리기 (백준)
#include #include typedef struct A{int x,y;}A; //x index, y power (입력값을 저장할 구조체)int tree[2000000] = {}; //segment tree (n의 최댓값 50만 * 4)int compare(const void *a, const void *b) { //qsort, 오름차순 정렬, 구조체 y값 기준 return (*(A*)a).y - (*(A*)b).y;//왼쪽이 더 크면 +, 오른쪽이 더 크면 -, 같다면 0}int find(int s, int e, int node, int l, int r) { //segment tree 탐색 if(s > r || e e) return; tree[node] += dif; if(s==e) return..
c언어/BAEKJOON
2024. 8. 3. 09:48
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- C++
- 최소 스패닝 트리
- union
- 스택
- DP
- 기하학
- Lazy Propagation
- 정렬
- find
- 오프라인 쿼리
- 누적합
- 문자열
- DFS
- 1835
- C언어
- 덱
- XOR
- java
- 브루트포스
- Krustal
- 그리디
- 세그먼트 트리
- PASCAL
- Segment Tree
- 백준
- 누적 합
- 그래프
- 1835번
- 구현
- BFS
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함
