#include int w=0, h=0, n=0; //크기를 지칭하는 배열 및, 회로개수 typedef struct A { //구조체 char x; char y; }A; int f(int x, int y) { //범위를 넘어가면 false 아니면 true return (x >= 0 && x = 0 && y < h); } int main(void) { scanf("%d %d", &w, &h); //크기 입력 scanf("%d", &n); //회로 개수 입력 A map[50][50] = {}; //맵에 있는 회로의 종류 (없으면 0, 0) A q[34000] = {}; //queue int qLeft = 0, qRight=0; //큐 왼쪽, 오른쪽 A lamp[2500] = {}; //la..
#include #include typedef struct Node{int x, y, v;}Node; //간선 구조체 typedef struct Pair{int y, v;}Pair; //정수형 변수 두개 묶어논 구조체 typedef struct qNode { //큐에 들어갈 구조체 Pair data; struct qNode* next; //다음 큐의 구조체를 가리킵니다. }qNode; typedef struct Queue {//큐 qNode* front; qNode* rear; int cnt; }Queue; void init(Queue* q) {//큐 초기화 q->cnt = 0; q->front = q->rear = NULL; } int isEmpty(Queue* q) {return q->cnt==0;}..
#include int main(void) { int f, s, g, u, d; scanf("%d %d %d %d %d", &f, &s, &g, &u, &d); int visit[f+1]; for(int i = 0; i 2 -> 3 -> 4 여기서 3, 4는 두 번째 층 코드에서 if(--ans[acnt] == 0) acnt++; 을 통해 층에 있는 모든 노드를 지나가면 층을 내려간다. visit[] : 방문 안 했다면 0, 그렇지 않으면 1 ptr : BFS에서 큐를 차례차례 살펴보기 위한 변수
- Total
- Today
- Yesterday
- 6198번
- 오프라인 쿼리
- 최대공약수
- find
- 그리디
- 16120번
- 플로이드
- 백준
- 누적합
- 정렬
- BFS
- 스택
- Mo.s
- 6198
- Krustal
- DFS
- DP
- union
- 1835번
- 카드
- 그래프
- C++
- java
- 1835
- 덱
- 누적 합
- 최소 스패닝 트리
- 세그먼트 트리
- C언어
- 트리
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |