본문 바로가기
728x90
반응형

전체 글163

백준 11048 코드 n, m = map(int, input().split()) candies = [list(map(int, input().split())) for i in range(n)] # 1, 1부터 시작이므로 1 더 큰 2차원 배열 생성 result = [[0] * (m+1) for i in range(n+1)] for x in range(1, n+1): for y in range(1, m+1): result[x][y] = max(result[x-1][y], result[x][y-1], result[x-1][y-1]) + candies[x-1][y-1] print(result[n][m]) 2023. 5. 24.
백준 2193 코드 n = int(input()) def dp(n): dp = [0] * (n+1) dp[1] = 1 # 1 if n >= 2: dp[2] = 1 # 10 for i in range(3, n+1): dp[i] = dp[i-1] + dp[i-2] return dp[n] result = dp(n) print(result) 2023. 5. 23.
백준 14888 #2 코드 길이 약간 단축. 백준 14888 다른 풀이 버전. import sys import itertools input = sys.stdin.readline n = int(input()) # 숫자 number = list(map(int, input().split())) #연산자 카운트 operator = list(map(int, input().split())) result = [] real_operator = [] # 연산자로 바꿔주는 함수 def pick_operator(operator): if operator[0] != 0: for i in range(operator[0]): real_operator.append("+") if operator[1] != 0: for i in range(operator[.. 2023. 5. 23.
백준 14888 코드 import sys from itertools import permutations def calculate(operands, operators): result = operands[0] for i in range(1, len(operands)): if operators[i-1] == '+': result += operands[i] elif operators[i-1] == '-': result -= operands[i] elif operators[i-1] == '*': result *= operands[i] elif operators[i-1] == '/': if result < 0: result = -((-result) // operands[i]) else: result //= operands[i] r.. 2023. 5. 23.
#4(최종) AWS Elastic Beanstalk 기반 CI/CD 블루그린 배포 - 설정 파일 작동 원리 설정 파일 작동 원리 Elastic Beanstalk은 배포 파일을 전달 받으면, 각종 설정 파일들을 실행하고 나서, 애플리케이션 실행 단계를 거치게 된다. 이때, Elastic Beanstalk이 배포 애플리케이션을 실행한다는 것의 의미는, Procfile 파일을 실행하는 것이다. 그래서 Procfile 안에는 .ebextensions 파일에 /sbin/appstart 스크립트를 실행하는 코드만이 담겨져 있다. * Procfile springapp: appstart * .ebextensions/00-makeFiles.config files: "/sbin/appstart": mode: "000755" owner: webapp group: webapp content: | #!/usr/bin/env bash.. 2023. 5. 23.
#3 AWS Elastic Beanstalk 기반 CI/CD 블루그린 배포 - deploy.yml Elastic Beanstalk에 접근하기 위해서는, * Elastic Beanstalk 콘솔 * AWS Command Line Interface(AWS CLI) * EB CLI 를 사용할 수 있다. 그러나 Github Actions 플러그인 Beanstalk Deploy를 사용할 경우, 배포 코드만 작성해 주면 사용할 수 있다는 장점이 있으므로, deploy,yml 파일을 작성해서 사용하도록 할 것이다. * Beanstalk Deploy 문서 https://github.com/marketplace/actions/beanstalk-deploy Beanstalk Deploy - GitHub Marketplace Deploy a zip file to AWS Elastic Beanstalk github.com.. 2023. 5. 23.
728x90
반응형