전체 글
-
9205.맥주 마시면서 걸어가기Programmers 2024. 4. 20. 19:54
https://www.acmicpc.net/problem/9205 from collections import deque t = int(input()) # 테스트 개수 def bfs(x, y, graph): # 한 박스당 1000m 이동 가능(50*20) # 1000M 내로 편의점 / 목적지 도달 실패 ==> sad while graph: a, b = graph.popleft() if abs(x-a) + abs(y-b) >= 1000: print("sad") return False else: x, y = a, b print("happy") return True # main for _ in range(t): n = int(input()) # 맥주를 파는 편의점의 개수 graph = deque() start_..
-
[Cloud] UDR : User Defined RouteNetwork 2024. 4. 19. 17:14
클라우드 네트워크에서 사용자가 정의한 라우팅 테이블 UDR은 가상 네트워크에서 특정 트래픽 패턴을 사용자가 원하는 대로 제어할 수 있도록 한다.이를 통해 사용자는 특정 IP 주소 범위, 서브넷, 가상 네트워크 등에 대한 트래픽 경로를 사용자 정의할 수 있다.- 보안 및 네트워크 관리 : 보안 요구사항에 따라 특정 IP 주소 또는 서브넷에 대한 트래픽 경로를 변경할 수 있음- 트래픽 경로 변경 : 기본적으로 설정된 네트워크 경로를 변경하여 특정 트래픽을 특정 디바이스로 리디렉션할 수 있음 - 트래픽 감시 및 분석 : 특정 트래픽 패턴을 분석하거나 감시하기 위해 특정 트래픽 경로를 설정할 수 있다.일례로, 클라우드 환경에서 가상 네트워크에 연결된 가상 머신 간의 트래픽을 모니터링하고 분석하려는 경우 UDR을..
-
2468. 안전영역Programmers 2024. 4. 18. 19:56
그저 최소(최대)만 보면 BFS로 눈돌아가는 나..(언제 정신차릴래)ㅜ from collections import deque n = int(input()) graph = [list(map(int, input().split())) for _ in range(n)] # max 값 찾기(O(n)) max_value = 0 for i in range(len(graph)): a = max(graph[i]) if a > max_value: max_value = a q = deque([(0,0)]) i = 0 count = 1 # 1씩 줄여나가면서 안전 영역 개수 찾기 by BFS while q: x, y = q.popleft() value = max_value - i dx = [0, 0, 1, -1] dy = [1..
-
라이브러리, 프레임워크, 툴의 차이Intern 2024. 4. 17. 11:50
1. 라이브러리 : 맨땅에 헤딩하여 얻은 프로그램을 다른 사람들이나 본인이 나중에 사용하기 위해 가공한 것이다. 특정 기능에 대한 API를 모은 집합을 라이브러리라고 한다. Ex. jQuery : javascript에서 자 주 쓰이는 편리한 함수를 만들어 둔 것 2. 프레임워크 : 정해진 틀에서 일을 할 수 있도록 만들어진 것으로, 예를 들어 웹에 특화하여 더 빠르게, 더 쉽게 만들수 있도록 한 것이 프레임워크다. application 개발 시 코드의 품질, 필수코드, 알고리즘, 암호화, 데이터베이스 연동 같은 기능들이 어느 정도 구성되어 있는 뼈대를 제공하도록 만들어진 것이다. S/W에서 프레임워크는 소프트웨어의 특정 문제를 해결하기 위해서 상호 협력하는 클래스와 인터페이스의 집합이라고 할 수 있으며,..
-
[2644]촌수 계산Programmers 2024. 4. 10. 18:12
https://www.acmicpc.net/problem/2644 2644번: 촌수계산 사람들은 1, 2, 3, …, n (1 ≤ n ≤ 100)의 연속된 번호로 각각 표시된다. 입력 파일의 첫째 줄에는 전체 사람의 수 n이 주어지고, 둘째 줄에는 촌수를 계산해야 하는 서로 다른 두 사람의 번호가 주어 www.acmicpc.net 처음엔 DFS로 접근을 하려고 했으나..문제가 있었다. n = int(input()) a, b = map(int, input().split()) m = int(input()) graph = [[] for _ in range(n+1)] for _ in range(m): x, y = map(int, input().split()) graph[x].append(y) graph[y]...
-
[Kubernetes] Replica SetKubernetes 2024. 4. 3. 23:18
Pod는 여러 개의 컨테이너를 추상화해 하나의 애플리케이션으로 동작하도록 만드는 훌륭한 컨테이너 묶음이다. 그러나 YAML에 파드만 정의해 생성하게 되면 이 파드의 LifeCycle은? kubectl delete 명령어로 파드를 삭제하게 되면 그 파드의 컨테이너 또한 삭제된 뒤 쿠버네티스에서 영원히 사라지게 도니다. 이렇게 YAML 파일에 파드만 정의해 생성할 경우 해당 파드는 오직 쿠버네티스 사용자에 의해 관리된다. 이렇게 되면 단순히 파드의 기능을 테스트하는 것이 아닌 실제 외부 사용자의 요청을 처리해야 하는 MSA 구조의 파드라면 이러한 방식을 사용하기 어렵다. MSA에서는 여러 개의 동일 컨테이너를 생성한 뒤 외부 요청이 각 컨테이너에 적절히 분배될 수 있어야 한다. 쿠버네티스에서는 파드가 기본 ..
-
[Kubernetes] PodKubernetes 2024. 4. 3. 20:39
쿠버네티스에는 컨테이너 애플리케이션을 구동하기 위해 반드시 알아야할 몇 가지 오브젝트가 존재한다. Pod / Replica Set / Service / Deployment 그 중 하나인 Pod에 대해서 알아보자. Pod 컨테이너 애플리케이션의 기본 단위이며, 1개 이상의 컨테이너로 구성된 컨테이너의 집합이다. 파드는 쿠버네티스에서 가장 기초적이고 중요한 개념이기 때문에, 반드시 이해해야 하는 개념이다. 쿠버네티스에서는 컨테이너 애플리케이션을 배포하기 위한 기본 단위로 파드라는 개념을 사용한다. 1개의 파드에는 1개의 컨테이너가 존재할 수도 있고, 여러 개의 컨테이너가 존재할 수도 있다. # nginx-pod.yaml apiVersion: v1 kind: Pod metadata: name: my-nginx..