
#include #include long long tree[600000] = {}, start[200001]={}, end[200001]={}, dif[200001] = {}, ETT=0;char v[200001] = {};typedef struct list{ //단방향 리스트 struct list * next; long long val;}list;void insert(int x, int y, list vec[]) { //리스트 삽입, x을 기준으로 봅니다. list * newNode = (list*) malloc(sizeof(list)); newNode->val = y; newNode->next = vec[x].next; vec[x].next = newNode;}void dfs(int x, int y,..
#include #include int tree[266000]={}, start[100001]={}, end[100001]={}, ETT=0;char lazy[266000]={};typedef struct list{ //단방향 리스트 struct list * next; int val;}list;void insert(int x, int y, list vec[]) { //리스트 삽입 list * newNode = (list*) malloc(sizeof(list)); newNode->val = y; newNode->next = vec[x].next; vec[x].next = newNode; return;}void dfs(int x, list vec[]) { //ETT start[x] = ++ETT; for(l..
#include #include int tree[266000] = {}, ETT=0;typedef struct list { //단뱡향 리스트 struct list * next; int val; }list;void insert(int x, int y, list vec[]) { //리스트 삽입 list * newNode = (list*) malloc(sizeof(list)); newNode->val = y; newNode->next = vec[x].next; vec[x].next = newNode; return;}void dfs(int x, int start[], int end[], list vec[]) { //ETT start[x] = ++ETT; for(list *p = vec[x].next; p!=NU..
#include #include int ETT = 0; //오일로 경로 트릭을 위한 변수int tree[266000]={}, lazy[266000]={}, arr[100001]={}; //lazy propagationtypedef struct list{ //리스트 자료구조를 위한 구조체 struct list * prev; struct list * next; int val;}list;void insert(int s, int val, list vec[]) { //리스트에 삽입 list * newNode = (list*) malloc(sizeof(list)); newNode->val = val; newNode->next = vec[s].next; newNode->prev ..
- Total
- Today
- Yesterday
- Krustal
- 그리디
- 최대공약수
- DP
- 기하학
- 누적합
- 정렬
- BFS
- 덱
- C++
- 스택
- DFS
- union
- Lazy Propagation
- 플로이드
- 그래프
- Segment Tree
- 오프라인 쿼리
- PASCAL
- C언어
- 누적 합
- 브루트포스
- 최소 스패닝 트리
- java
- XOR
- find
- 백준
- 1835번
- 세그먼트 트리
- 1835
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |