일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 소수
- springboot
- 코딩테스트
- algorithm
- 알고리즘
- applicationeventpublisher
- spring security
- API
- HTTP
- 라이브템플릿
- java
- 2981
- Greedy
- beandefinitionstoreexception
- error
- Spring
- Dijkstra
- BFS
- counting elements
- Python
- 파이썬
- 백준
- 2018 KAKAO BLIND RECRUITMENT
- 문자열
- 최단경로
- 프로그래머스
- 탐욕법
- codility
- brute force
- javascript
Archives
- Today
- Total
목록time complexity (1)
Altiora Petamus

TapeEquilibrium coding task - Learn to Code - Codility Minimize the value |(A[0] + ... + A[P-1]) - (A[P] + ... + A[N-1])|. app.codility.com 🤔생각해보기 문제 그대로 단순히 배열을 slice 하는 방식으로 풀었더니 시간복잡도 문제라 그런지 점수가 아주 짜게 나왔다. 그래서 Dynamic programming 으로 풀어보았다. 합을 저장해가는 배열을 만들어둔다. 그 배열에서 하나씩 꺼내서 연산을 진행하면, 다시 처음부터 합을 구할 필요가 없다. 첫번째 풀이 - Total score 61% def solution(A): result = 0 dp = [0] * (len(A) - 1) dp[0] = A[..
1day-1algorithm
2021. 7. 1. 20:28