전체 글345 MySQL create user, grant all privileges root 권한 접속 use mysql; select host, user from user; create user mj@localhost identified by 'password'; create database DB이름 grant all privileges on `DB이름`.* to `mj`@`localhost` with grant option; mj 권한 접속 create table DEPARTMENT( ... ) 자유롭게 사용할 수 있다. 2022. 4. 4. [openCV] fingerprint equalization, binarization, morphology, smoothing, skeletonization 평탄화(Equlaization) 명암 대비를 높이기 위함 검은 곳은 더 검게, 밝은 곳은 더 밝게 https://opencv-python.readthedocs.io/en/latest/doc/20.imageHistogramEqualization/imageHistogramEqualization.html 히스토그램 균일화 — gramman 0.1 documentation CLAHE (Contrast Limited Adaptive Histogram Equalization) 지금까지의 처리는 이미지의 전체적인 부분에 균일화를 적용하였습니다. 하지만 일반적인 이미지는 밝은 부분과 어두운 부분이 섞여 있기 때문에 전 opencv-python.readthedocs.io equalizeHist 함수 전체적으로 밝아지기는.. 2022. 3. 29. [이분탐색] 백준 3745 오름세(가장 긴 증가하는 부분수열) # 가장 긴 증가하는 부분 수열 import sys def find(x): l = 0 r = len(result)-1 while l 2022. 3. 28. [누적합] 백준 3020 개똥벌레 생각을 좀 다르게 가져야하는 문제 창의성이 필요했다. import sys N, H = map(int, sys.stdin.readline().split()) up = [0]*(H+1) down = [0]*(H+1) # up[i] : 개똥벌레가 i(밑에서부터)로 날때 파괴해야하는 장애물 개수 for i in range(N): if i%2==0: up[int(sys.stdin.readline())]+=1 else: down[int(sys.stdin.readline())]+=1 for i in range(H, 1, -1): up[i-1]+=up[i] down[i-1]+=down[i] obs_min = N for i in range(1, H+1): up[i] = up[i] + down[H-i+1] if obs_m.. 2022. 3. 20. [dijkstra] 백준 11779 최소비용 구하기2(다익스트라 + 경로 노드) 기존 다익스트라 문제 + 거쳐가는 경로 노드를 구해야 하는 문제 import sys import heapq # 기존 다익스트라는 최소 거리만 계산 # 하지만 이 문제에서는 거쳐가는 노드를 출력해야한다. def dijkstra(start, end, n): distances = [float('inf')]*(n+1) distances[start]=0 visit = [[] for _ in range(n+1)] visit[start].append(start) heap = [[0, start]] while heap: current_dist, current_idx = heapq.heappop(heap) if current_dist > distances[current_idx]: continue for next_idx,.. 2022. 3. 19. [dijkstra] 백준 10282 해킹 답이 맞긴한데 시간초과.. 시간초과 import sys from collections import deque T = int(sys.stdin.readline()) def infection(graph, c, n): time = [sys.maxsize]*(n+1) time[c]=0 q = deque() q.append(c) while q: p = q.popleft() for i, w in graph[p]: time[i] = min(time[i], time[p]+w) if i not in q: q.append(i) cnt = 0 ans = 0 for t in time: if t != sys.maxsize: cnt+=1 ans = max(ans, t) print(cnt, ans) for _ in range(T).. 2022. 3. 17. 이전 1 ··· 4 5 6 7 8 9 10 ··· 58 다음