[백준/14503/파이썬] 로봇 청소기 (Python,구현)
[백준/파이썬] 14503번 : 로봇 청소기 (Python,구현) 14503번: 로봇 청소기 (acmicpc.net) 코드 # https://www.acmicpc.net/problem/14503 from sys import stdin n, m = map(int,stdin.readline().split()) ## 행 , 열 y, x, d = map(int, stdin.readline().split()) ## 처음 위치 (x,y), 방향 arr =[] for i in range(n): arr_temp = list(map(int,stdin.readline().split())) arr.append(arr_temp) # a = arr[y][x] # print(a) # d 방향 # if d == 0: #북쪽 # p..
2023. 4. 13.
[백준/24483/파이썬] 알고리즘 수업 - 깊이 우선 탐색 5 (dfs,Python)
[백준/24483/파이썬] 알고리즘 수업 - 깊이 우선 탐색 5 (dfs,Python) 24483번: 알고리즘 수업 - 깊이 우선 탐색 5 (acmicpc.net) 코드 from sys import stdin,setrecursionlimit input = stdin.readline N, M, R = map(int, input().split()) # 정점, 간선, 시작라인 setrecursionlimit(N+10) # 방문 순서, 깊이 구하기 visited = [-1] * (N+1) #방문 판단 graph = [[]for _ in range(N+1)] #정점 연결 # -- 입력 및 그래프 연결 -- # for _ in range(M): # 간선의 이어진 개수만큼이기 때문에 u, v = map(int, in..
2023. 3. 15.