일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- 티스토리챌린지
- http 메시지 컨버터
- 싱글톤
- 스프링
- java
- DI
- 의존관계
- 예외와 트랜잭션 커밋
- html form
- 스프링컨테이너
- 추상클래스
- 다익스트라
- 김영한
- 인터페이스
- 코딩테스트
- equals()
- 서블릿
- 오버라이딩
- objecterror
- 코드트리
- HttpServletResponse
- 참조변수
- 백준
- 프로그래머스
- 프록시
- 오블완
- @configuration
- fielderror
- 테스트코드
- 코드트리조별과제
- Today
- Total
목록Problem Solving (18)
minOS
https://www.acmicpc.net/problem/1719 import sysimport heapqINF = sys.maxsizen,m = map(int,input().split())graph = [[] for _ in range(n+1)]for _ in range(m): a,b,time = map(int,input().split()) graph[a].append((time,b)) graph[b].append((time,a))def dijkstra(start): dist[start] =0 heapq.heappush(pq,(0,start)) while pq : min_dist,min_node = heapq.heappop(pq) ..
https://school.programmers.co.kr/learn/courses/30/lessons/258712 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr def solution(friends, gifts): n = len(friends) d = dict() d = {friends[i]: i for i in range(n)} ans = {i : 0 for i in range(n)} array = [[0 for _ in range(n)] for _ in range(n)] for gift in gifts: arr = gift.split() array[..
https://school.programmers.co.kr/learn/courses/30/lessons/12980 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 처음에 BFS 풀었다가 효율성에서 막혔다 from collections import dequedef solution(n): q= deque() visited = [0 for _ in range(n+1)] q.append((1,1)) visited[1] =1 while q : x,step = q.popleft() if x == n : return step ..
https://www.acmicpc.net/problem/5567문제를 보고 상근이의 친구와 그 친구의 친구를 찾아야하니깐 상근이와 거리가 1,2 인 사람들을 찾아야겠다고 생각하였습니다.상근이 학번은 1 이므로 처음 큐에 1을 넣고 시작하고, 그래프를 통해 방문 가능한 (아직 방문하지 않은)친구들과의 거리를 계산하고 큐에 새로운 친구들을 넣어줍니다. 이러한 과정을 큐에 아무런 원소도 없을때까지 반복하면 visited 배열에 상근이와 친구들의 거리를 알 수 있습니다. 저는 상근이를 방문했다는 의미로 visited[1] =1 이기 때문에 visited 배열이 2와 3 사이인 경우를 세주면 답이 나옵니다.from collections import dequen = int(input())m = int(input(..
https://www.acmicpc.net/problem/2941문제를 보고 .. dž 변경만 3자리고 나머지는 두자리라는 것이 눈에 들어와서 알파벳 검사를 3자리와 2자리 그리고 나머지로 나누면 개수가 나올 것 이라고 생각하였습니다.word = input()string = {"c=", "c-","d-", "lj","nj","s=","z="}ans =0idx =0while idx != len(word): if word[idx:idx+3] == "dz=": ans+=1 idx += 3 elif word[idx:idx+2] in string: ans+=1 idx+=2 else: idx+=1 ans+=1print(ans..
https://www.acmicpc.net/problem/15686 치킨집 좌표와 집 좌표를 리스트에 저장했다.그 후에 치킨집 좌표 m개를 고르고 , 치킨 거리를 계산하도록 했다. 도시의 치킨 거리는 당연히 치킨집개수Cm 만큼 나올 것이다. 그 중에서 가장 작은 값을 출력하면 된다. n,m = map(int,input().split())graph = [list(map(int,input().split())) for _ in range(n)]chicken =list()home = list()ans =list()result = list()for i in range(n): for j in range(n): if graph[i][j] == 1: home.append((i+1,..