전체 글 191

SQLD(SQL 개발자) 7시간 벼락치기 합격 후기

🔹시험 정보SQL 자격증 종류 : SQLP(SQL 전문가), SQLD(SQL 개발자)SQLD는 SQLP에 비해 난이도 낮음응시 자격 조건이 없고 비교적 쉬운 난이도로 응시자 많음 상세 설명은 아래 홈페이지 참고(SQLD 응시자격, 시험 내용, 배점, 합격기준 등)https://www.dataq.or.kr/www/sub/a_04.do 🔹베이스벼락치기 전문가IT 관련 학과 4학년대학에서 데이터베이스 과목 수강프로젝트에서 DB 사용 경험 O (MySql, MariaDB) 🔹학습방법유튜브 강의 → 정리본 2회독 → 중요부분 암기준비기간 : 7시간 합격점수 : 68점/100점 (60점 이상 합격) 🔹후기IT 관련 학과 전공자 or DB 기초 개념 O단시간 내 취득 가능DB 지식 전혀 없는 비전공자하루 2-..

카테고리 없음 2024.11.06

백준_python 1753번 최단경로 (그래프, 다익스트라 )

링크>https://www.acmicpc.net/problem/1753  sol1 )  다익스트라 알고리즘으로 최단경로 탐색123456789101112131415161718192021222324252627282930313233343536373839import sysimport heapqinput = sys.stdin.readline def dijkstra(s, dis):    dis[s] = 0    q = []    heapq.heappush(q, (0, s))    while q:        cur_dis, now = heapq.heappop(q)        if cur_dis > dis[now]:            continue        for n, weight in graph[now]:..

백준_python 1158번 요세푸스 문제 (deque, 수학, 시간복잡도)

링크>https://www.acmicpc.net/problem/1158   sol1 ) deque을 이용한 풀이12345678910111213from collections import deque n, k = map(int, input().split())q1 = deque([i for i in range(1,n+1)])answer = [] for _ in range(n):    for _ in range(k-1):        q1.append(q1.popleft())    answer.append(q1.popleft()) print(',end='')print(*answer, sep=', ', end='>')cs deque를 이용한 직관적 풀이그러나 시간복잡도가 O(N*k)로, k 크기 증가하면 비효율적 ..

백준_python 5397번 키로거 (스택, 연결리스트(LinkedList))

링크>https://www.acmicpc.net/problem/5397   sol1 ) stack을 이용한 풀이1234567891011121314151617181920212223import sysinput = sys.stdin.readline t = int(input()) for _ in range(t):    str1 = []    str2 = []    for i in input().rstrip():        if i == '-':            if str1:                str1.pop()        elif i == ':            if str1:                str2.append(str1.pop())        elif i == '>':    ..

백준_python 13549번 숨바꼭질 (메모리 초과, BFS, 최단거리)

링크>https://www.acmicpc.net/problem/13549   sol1 ) 나의 오답 - 메모리 초과1234567891011121314from collections import dequen, k = map(int, input().split())graph = deque([(n, 0)]) while True:    now, time = graph.popleft()        if now == k:        print(time)        break     graph.append((now * 2, time))    graph.append((now + 1, time + 1))    graph.append((now - 1, time + 1))cs 예제는 맞췄지만, 채점 시 메모리 초과 발생 ..

백준_python 3273번 두 수의 합 (정렬, 투 포인터)

링크>https://www.acmicpc.net/problem/3273    sol 1 ) 배열에 인덱스 저장하고 값 비교해 계산 1234567891011121314n = int(input())arr = list(map(int, input().split()))x = int(input()) arr2 = [0] * 2000000for i in range(n):    arr2[arr[i]] = i cnt = 0for i in range(n):    if arr2[x - arr[i]] > i:        cnt += 1 print(cnt)cs 입력을 arr에 받고, 각 원소를 인덱스로 하는 arr2 배열에 인덱스를 저장했다.정답이었지만, 문제를 잘못 이해한 풀이고,메모리 사용(불필요하게 큰 arr2 배열) 측..

백준_python 1068번 트리 (DFS)

링크>https://www.acmicpc.net/problem/1068   sol ) dfs를 이용한 리프 노드 탐색12345678910111213141516171819202122232425262728293031323334import sysinput = sys.stdin.readline def dfs(node, tree, visited):    visited[node] = True    for i in range(len(tree)):        if tree[i] == node and not visited[i]:            dfs(i, tree, visited) n = int(input())tree = list(map(int, input().split()))del_node = int(input..

백준_python 1991번 트리 순회 (Node class, 트리, 재귀)

링크>https://www.acmicpc.net/problem/1991   sol ) 재귀를 이용한 트리 탐색123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051import sysinput = sys.stdin.readline class Node:    def __init__(self, item, left, right):        self.item = item        self.left = left        self.right = right def pre_order(node):    result.append(node.item)    if node.left != '.':       ..

백준_python 9372번 상근이의 여행 (그래프, 트리)

링크>https://www.acmicpc.net/problem/9372  sol ) DFS로 국가(노드) 탐색하여 비행 횟수 구하기12345678910111213141516171819202122232425import sysinput = sys.stdin.readline def dfs(node, cnt):    visited[node] = True    for n in tree[node]:        if not visited[n]:            cnt = dfs(n, cnt+1)    return cnt t = int(input()) for _ in range(t):    n, m = map(int, input().split())    tree = [[] for _ in range(n+1)]  ..

백준_python 1967번 트리의 지름 (트리, DFS)

링크>https://www.acmicpc.net/problem/1967  sol ) DFS를 이용한 최대 경로 길이 탐색123456789101112131415161718192021222324252627282930313233343536373839404142434445import sysinput = sys.stdin.readlinesys.setrecursionlimit(10**5) def dfs(node):    global max_dia, tree, visited    # 현재 노드에서 자식 노드로 가는 경로 중 가장 긴 경로 두개 저장    long_one, long_two = 0, 0    # 인접 노드 탐색    for cn, cw in tree[node]:        if not visited[c..

카테고리 없음 2024.08.06