본문 바로가기

전체 글11

[Python] 백준 1043번 - 거짓말 문제백준 1043번최종 코드import sysinput = sys.stdin.readlinen, m = map(int, input().split())truth = list(map(int, input().split()))people = [i for i in range(n + 1)]parties = []def union(a, b): if people[a] != a: a = find(a) if people[b] != b: b = find(b) if a != b: people[b] = adef find(a): if people[a] == a: return a root = find(people[a]) people[a] = root .. 2024. 5. 6.
[Python] 백준 1976번 - 여행 가자 문제백준 1976번최종 코드import sysfrom collections import dequeinput = sys.stdin.readlinen = int(input())m = int(input())cities = [[0] for _ in range(n + 1)]# 연결 여부 확인def check_path(start, end): if start == end: return True que = deque() que.append(start) visited = [False] * (n + 1) visited[start] = True while que: now = que.popleft() if cities[now][end] == 1: .. 2024. 4. 3.
[NestJS] 동적 모듈 사용 시 환경 변수 파일이 복사가 안 되는 문제 문제 상황NestJS로 배우는 백엔드 프로그래밍 도서를 이용하여 동적 모듈 관련 공부를 진행 중/src/config/env/ 디렉토리 하위에 환경 변수 파일들을 관리하도록 했는데앱 구동 시 환경 변수 파일을 읽지 못해 예상하지 못한 에러가 발생했다... nest-cli.json{ "$schema": "https://json.schemastore.org/nest-cli", "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { "assets": [{ "include": "./config/env/*.env", "outDir": "./dist" }] }}위와 같이 .ts 파일 이외에 .en.. 2023. 11. 20.