[백준] 13460번 - 구슬 탈출 2 (파이썬)
# 구슬 탈출 2 from collections import deque import sys input = sys.stdin.readline # . # 0 R B => 빈칸, 장애물, 구멍, 빨간구슬, 파란구슬 N, M = map(int, input().split()) arr = [] red_x, red_y = 0, 0 blue_x, blue_y = 0, 0 for i in range(N): arr.append(list(input().strip())) for j in range(len(arr[i])): if arr[i][j] == 'R': red_x, red_y = i, j arr[i][j] = '.' elif arr[i][j] == 'B': blue_x, blue_y = i, j arr[i][j] = '..
2022. 2. 11.
[백준] 13459번 - 구슬 탈출 (파이썬)
# 구슬 탈출 from collections import deque import sys input = sys.stdin.readline # . # 0 R B => 빈칸, 장애물, 구멍, 빨간구슬, 파란구슬 N, M = map(int, input().split()) arr = [] red_x, red_y = 0, 0 blue_x, blue_y = 0, 0 for i in range(N): arr.append(list(input().strip())) for j in range(len(arr[i])): if arr[i][j] == 'R': red_x, red_y = i, j arr[i][j] = '.' elif arr[i][j] == 'B': blue_x, blue_y = i, j arr[i][j] = '.'..
2022. 2. 11.
[백준] 17143번 - 낚시왕 (파이썬)
# 낚시왕 import copy import sys input = sys.stdin.readline N, M, S = map(int, input().split()) arr = [[0] * (M+1) for _ in range(N+1)] for _ in range(S): n, m, speed, direction, big = map(int, input().split()) arr[n][m] = (speed, direction, big) shark_move = [[], [-1, 0], [1, 0], [0, 1], [0, -1]] def fishing(now): global result for i in range(1, N+1): if arr[i][now] != 0: result += arr[i][now][2] a..
2022. 2. 11.