목록C (1)
레야몬
1697번 숨바꼭질 - BFS
#include #include #define MAX_QUEUE_SIZE 100000 int memo[200000]; typedef struct _Loc { int s; int cnt; } Loc; typedef struct _Queue //큐 구현 { int front; int rear; Loc data[MAX_QUEUE_SIZE]; } Queue; void init_queue(Queue *q) { q->front=q->rear=-1; } void enqueue(Queue *q, Loc l) { q->data[(++q->rear)%MAX_QUEUE_SIZE]=l; } Loc dequeue(Queue *q) { return q->data[(++q->front)%MAX_QUEUE_SIZE]; } int m..
알고리즘/백준
2022. 8. 23. 21:21