일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 빅데이터분석
- bfs
- 코딩테스트
- 코딩일기
- 정렬
- BOJ
- DP
- 프로그래머스
- 구현
- 이진탐색
- 백준
- dfs
- 이것이코딩테스트다
- c++
- 이코테
- 앱개발
- 코테
- Typescript
- 개발자북클럽
- ps
- 타입스크립트
- 알고리즘
- TS
- 노마드코더
- 그리디
- react-native
- SQL
- 다이나믹프로그래밍
- 백준온라인저지
- 최단경로
- Today
- Total
목록PS/SWEA (5)
한량처럼 살고 싶다

https://swexpertacademy.com/main/code/problem/problemDetail.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 나보다 더 시간 복잡도가 낮게 푸신 분들도 많을 것 같다 (그냥 반복문 마구마구 돌렸기에) T = int(input()) for t in range(T): n, m = map(int, input().split()) graph = [] for i in range(n): tmp = list(map(int, input().split())) graph.append(tmp) answer = 0 for i in range(n-m+1): for j in range(..

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWngfZVa9XwDFAQU SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com dfs로 풀었더니 런타임이 떴다. bfs로 수정했더니 정답이 되었는데 이유를 모르겠다... from collections import deque T = int(input()) def bfs(start): global visit q = deque() q.append(start) visit[start] = True while q: now = q.popleft() for p in graph[now]: i..

https://swexpertacademy.com/main/code/problem/problemDetail.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 그렇게 어렵지 않은 문제였다. 엄청나게 많은 if문을 적었지만 사실 파이썬은 min 안에 여러 인자를 넣어도 된다고 하니 코드를 더 줄일 수 있을 것이다. 친구가 친절하게 가르쳐줬음. def solution(): for i in range(10): length = int(input()) heights = list(map(int, input().split())) answer = 0 #앞의 두개, 뒤의 두개를 제외 for index in range(2, l..

https://swexpertacademy.com/main/code/problem/problemDetail.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 뒤에서부터 가격을 체크해야하는 것이 포인트이다. def solution(T): for i in range(T): length = int(input()) arr = list(map(int, input().split())) answer = 0 #최종 금액 price = 0 #내가 소비한 가격 count = 0 #내가 산 개수 biggest_price = arr[length-1] for index in range(length-2, -1, -1): if arr..

https://swexpertacademy.com/main/code/problem/problemDetail.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com ps 언어를 파이썬으로 바꾼 기념 쉬운 문제를 풀어보았다. T = int(input()) for i in range(T): inputs = list(map(int, input().split())) answer = 0 for n in inputs: if n%2 != 0: answer += n print("#%d %d" %(i+1, answer))