(BOJ) 15683 감시 golang
package main import ( "bufio" "fmt" "os" ) type XY struct { x int y int } var dx = []int{-1, 0, 1, 0} var dy = []int{0, 1, 0, -1} var w = bufio.NewWriter(os.Stdout) var r = bufio.NewReader(os.Stdin) var N, M int var board, board2 [10][10]int func pad(x, y, dir int) { dir %= 4 for 1 == 1 { x += dx[dir] y += dy[dir] if 0 > x || x >= N || 0 > y || y >= M || board2[x][y] == 6 { // reach the wall bre..
2022. 5. 9.