가스관 (2931번) - 백준 (BOJ)
https://www.acmicpc.net/problem/2931 2931번: 가스관 www.acmicpc.net 백준 - 가스관 (CIJEVI) (2931번) 난이도 : Gold 3 알고리즘&자료구조 : Simulation (구현) ★ 핵심 Idea ★ M에서 출발해서 파이프를 쭉 따라가며 중간에 끊긴 좌표를 찾고, 그 좌표의 상하좌우를 확인하면서 알맞은 모양의 파이프를 찾는다. import sys input = sys.stdin.readline class Pipe(): def __init__(self, R, C): self.R, self.C = R, C dd = [[-1, 0, 1, 0], [0, 1, 0, -1]] mapping = {0: 2, 1: 3, 2: 0, 3: 1} r,..