From abbdab565e0ac94773d6e9954eb00bccf8edf504 Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Tue, 29 Jul 2025 22:35:28 +0900 Subject: [PATCH] 20250729 baekjoon --- code_study/Baekjoon/c/21736.c | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 code_study/Baekjoon/c/21736.c diff --git a/code_study/Baekjoon/c/21736.c b/code_study/Baekjoon/c/21736.c new file mode 100644 index 0000000..9652ca9 --- /dev/null +++ b/code_study/Baekjoon/c/21736.c @@ -0,0 +1,62 @@ +#include +#include +#include + +int main() { + int N, M; + scanf("%d %d",&N, &M); + + char** campus = (char**)malloc(sizeof(char*)*N); + int** visited = (int**)malloc(sizeof(int*)*N); + for(int i=0; i=M || ny<0 || ny>=N || visited[ny][nx] || campus[ny][nx] == 'X') continue; + visited[ny][nx] = 1; + queueX[rear] = nx; + queueY[rear] = ny; + rear++; + if(campus[ny][nx] == 'P') friendCount++; + } + } + + if(friendCount) printf("%d\n",friendCount); + else printf("TT\n"); + + for(int i=0; i