목록큐 (1)
레야몬
[C언어] 7576번 토마토 - 그래프 이론, BFS
#include #include #define MAX_QUEUE_SIZE 006000 typedef struct Co { //좌표를 영어로 하면 coordinate int x; int y; int day; } Co; typedef struct Queue { //큐 구현 int start; int rear; Co data[MAX_QUEUE_SIZE]; } Queue; int a[4] = {1, 0, -1, 0}; //상하좌우 int b[4] = {0, -1, 0, 1}; void enqueue(Queue *q, Co c) { q->rear = (q->rear+1)%MAX_QUEUE_SIZE; q->data[q->rear]=c; } Co dequeue(Queue *q) { q->start=(q->start+..
알고리즘/백준
2022. 8. 26. 15:44