[백준] 2667번 단지 번호 붙이기 (C)
출처 : KOI 1996 초등부 1번 알고리즘 : Flood Fill 풀이 Flood Fill 알고리즘을 그 이상 그 이하도 아니다. 알고리즘만 알면 간단히 풀 수 있다. 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 #include #include #include using namespace std; vector ans; int in[27][27]; int check[26][26]; int dir[4][2]={{0,1}, {0,-1}, {1,0}, {-1,0}}; int fill(int a, int b){ int c..