๋ฐฑ์ค€ 1189๋ฒˆ - ์ปด๋ฐฑํ™ˆ
ยท
Algorithm/๋ฐฑ์ค€
https://www.acmicpc.net/problem/1189 1189๋ฒˆ: ์ปด๋ฐฑํ™ˆ ์ฒซ ์ค„์— ์ •์ˆ˜ R(1 ≤ R ≤ 5), C(1 ≤ C ≤ 5), K(1 ≤ K ≤ R×C)๊ฐ€ ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„๋˜์–ด ์ฃผ์–ด์ง„๋‹ค. ๋‘ ๋ฒˆ์งธ๋ถ€ํ„ฐ R+1๋ฒˆ์งธ ์ค„๊นŒ์ง€๋Š” R×C ๋งต์˜ ์ •๋ณด๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” '.'๊ณผ 'T'๋กœ ๊ตฌ์„ฑ๋œ ๊ธธ์ด๊ฐ€ C์ธ ๋ฌธ์ž์—ด์ด ์ฃผ์–ด์ง„๋‹ค www.acmicpc.net ์–ด๋Š ํ•œ์ง€์ ์—์„œ ์‹œ์ž‘ํ•ด์„œ ๋‹ค๋ฅธ ์ง€์ ๊นŒ์ง€ ๊ฐˆ ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ๋ฐฉ๋ฒ•์„ ํƒ์ƒ‰ํ•ด์•ผ ํ•˜๋Š” ๋ฌธ์ œ์ด๋‹ค. ๊ทธ๋ž˜ํ”„ ํƒ์ƒ‰ + ๋ฐฑํŠธ๋ž˜ํ‚น ์œ ํ˜•์˜ ๋ฌธ์ œ์ด๋‹ค. ๋ฐฑํŠธ๋ž˜ํ‚น ๋ฌธ์ œ์—์„œ๋Š” ์žฌ๊ท€๋ฅผ ํ†ตํ•œ DFS ํƒ์ƒ‰์œผ๋กœ ํ‘ธ๋Š” ๊ฒƒ์ด ์ ํ•ฉํ•˜๋‹ค. ๊ทธ๋ž˜์„œ ํ’€๋ฉด์„œ ๊ฐ™์€ ์œ ํ˜•์ธ 1987๋ฒˆ ์•ŒํŒŒ๋ฒณ๊ณผ ๋น„์Šทํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๋‹ค. https://www.acmicpc.net/problem/1987 1987๋ฒˆ: ์•ŒํŒŒ๋ฒณ ์„ธ๋กœ..
giraffe_
'๋ฐฑํŠธ๋ ˆํ‚น' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก