IT 61

[SWEA] 2383. 점심 식사시간(python)

계단마다 사람을 배치하는 것은 모든 경우의 수를 다 고려했다. 계단과 사람과의 거리를 나타내는 배열 order, 계단입구를 나타내는 배열 entry, 계단을 내려가는 횟수를 기록하는 배열 down을 만들어 구현하였다. from itertools import combinations T = int(input()) def downTo(people,stair): order,down,entry=[],[],[] stairSize=stair[2] for person in people: order.append(abs(stair[0]-person[0])+abs(stair[1]-person[1])) order.sort() time=0 while order: time+=1 while entry and len(down)

IT/coding study 2022.09.16

[acmicpc] 14891. 톱니바퀴(python)

시뮬레이션 import sys from collections import deque input=sys.stdin.readline wheels=[[]] for i in range(4): wheels.append(deque(list(input().strip()))) K=int(input()) for i in range(K): num, dir=map(int,input().split()) moves = [0] * 5 # 회전할 톱니바퀴 방향 체크 moves[num] = dir left=wheels[num][6] for j in range(num-1,0,-1): # 맨왼쪽까지 비교 if wheels[j][2]==left: break # 극이 같으면 stop moves[j]=-moves[j+1] left=wheel..

IT/coding study 2022.09.01

nodejs express, kubernetes에 배포하기

작성중.. 1. docker image를 docker hub에 push하기 docker name으로 docker hub에 push 시, ImagePullBackOff 에러가 있어 먼저 tag를 지정해준다. 1) docker tag 지정하기 docker tag todolist_nodejs seyeon321/todolist_nodejs 2) docker hub 로그인 후 push docker login docker push seyeon321/todolist_nodejs 2. 쿠버네티스를 사용하여 클러스터에 이미지 배포하기 deployment.yml apiVersion: apps/v1 kind: Deployment metadata: name: todolist spec: selector: matchLabels:..

IT/도커 2022.07.13