[TIL] OOP & 3-Layered Architecture
04/24/24
![[TIL] OOP & 3-Layered Architecture](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1682591109869%2F352c32af-08f9-45e0-9d09-6b6c5ab68c02.png&w=3840&q=75)
Search for a command to run...
04/24/24
![[TIL] OOP & 3-Layered Architecture](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1682591109869%2F352c32af-08f9-45e0-9d09-6b6c5ab68c02.png&w=3840&q=75)
No comments yet. Be the first to comment.
https://school.programmers.co.kr/learn/courses/30/lessons/42891 효율성 테스트에 신경써야 하는 문제 우선순위 큐를 활용해서 먹는 시간이 짧은 음식부터 큐에서 빼기 import heapq # 우선순위큐 활용: food_time이 짧은 음식부터 삭제 def solution(food_times, k): if sum(food_times) <= k: return -1 ...
![[코테] 그리디 문제 - 무지의 먹방 라이브](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1712215455263%2F1ac1f35a-8862-4e42-8d0c-e2bea01e04c0.png&w=3840&q=75)
💡 첫 시도 시간초과! https://www.acmicpc.net/problem/7576 시간초과 코드 from collections import deque import sys input = sys.stdin.readline def bfs(x, y, visited): dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] while queue: x, y = queue.popleft() ...
![[코테] Bfs 토마토](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1709032619170%2F70056896-c857-444b-9c99-45bfcb466806.png&w=3840&q=75)
메인 함수에서 for문을 통해 여러번 dfs를 돌리며, dfs 함수 내에서 그래프 정보를 변경해주는 경우
![[코테] Dfs 문제 유형 - 그래프 내에서 구분하여 카운트 하기](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1709019361383%2Fb0585d72-c808-4169-83a9-2724f312e927.png&w=3840&q=75)
언제 뭘 선택해야 할까?
![[코테] DFS vs BFS](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708971211123%2F71f9386c-6a62-43b2-a602-4d084c24d6cf.png&w=3840&q=75)
💡 [출발지, 도착지] 형태로 주어진 비행기 티켓을 통해 모든 티켓을 사용할 수 있는 경우의 공항을 방문 순서 구하기 (단, 여러 공항을 방문할 수 있는 경우 알파벳이 빠른 공항부터 방문한다.) 틀렸던 코드 from collections import defaultdict def dfs(graph, route, depart): if graph[depart]: connected = graph[depart][0] ...
![[코테] 여행경로](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708971251412%2F27ce72ed-8ee7-4d13-a02f-ff4bbe50c4be.png&w=3840&q=75)