일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 백준
- kick start
- AI
- 파이썬
- 동적 프로그래밍
- 코딩
- CSS
- 구글 킥스타트
- 코딩테스트
- 동적프로그래밍
- 그래프
- nlp
- 네트워크
- OS
- 브루트포스
- 운영체제
- 킥스타트
- 알고리즘
- DFS
- 순열
- google coding competition
- PYTHON
- dp
- BFS
- 프로그래머스
- 딥러닝
- 코딩 테스트
- linux
- 프로그래밍
- 리눅스
- Today
- Total
목록알고리즘 (81)
오뚝이개발자
문제 https://www.acmicpc.net/problem/1504 1504번: 특정한 최단 경로 첫째 줄에 정점의 개수 N과 간선의 개수 E가 주어진다. (2 ≤ N ≤ 800, 0 ≤ E ≤ 200,000) 둘째 줄부터 E개의 줄에 걸쳐서 세 개의 정수 a, b, c가 주어지는데, a번 정점에서 b번 정점까지 양방향 길이 존 www.acmicpc.net 나의 풀이 방법은 두 가지가 있다. s -> v1 -> v2 -> n s -> v2 -> v1 -> n 각 경로가 최소가 되는 것을 찾으면 최종경로 또한 최소가 된다. 따라서 s, v1, v2를 시작점으로 해서 다익스트라 알고리즘을 3번 돌린 뒤에 위 두 경로 중 최단거리를 print하면 된다. 코드 # https://www.acmicpc.net/..
문제 https://www.acmicpc.net/problem/13549 13549번: 숨바꼭질 3 수빈이는 동생과 숨바꼭질을 하고 있다. 수빈이는 현재 점 N(0 ≤ N ≤ 100,000)에 있고, 동생은 점 K(0 ≤ K ≤ 100,000)에 있다. 수빈이는 걷거나 순간이동을 할 수 있다. 만약, 수빈이의 위치가 X일 www.acmicpc.net 나의 풀이 우선순위큐를 사용해서 풀면 된다. 큐에 삽입할 때는 시간이 빠른 순서로 정렬될 수 있도록 (시간, 위치)의 순서쌍을 넣어준다. 주의할 점은 삽입하는 순서인데, x 위치에서 가능한 총 경우의 수는 x-1, x+1, 2x의 세 가지이다. 이 때 순간이동을 하는 경우 소요되는 시간이 0초로 가장 짧으므로, 2x의 위치를 먼저 삽입한 뒤에 방문검사를 해서..
한국 시간으로 지난 주 일요일(3.20)에 있었던 킥스타트 Round A에 참가했다. 최종적으로는 4문제 중 2개를 풀었다. 그래도 지난 번 처음 참가했을 때 1개밖에 풀지 못했던 것과 비교하면 나름 선방한 것 같다. 1, 2번 문제는 어렵지는 않았는데 시간초과가 나지 않도록 잘 짜는 것이 관건이었다. 1. Speed Typing 문제 :https://codingcompetitions.withgoogle.com/kickstart/round/00000000008cb33e/00000000009e7021 Kick Start - Google’s Coding Competitions Hone your coding skills with algorithmic puzzles meant for students and th..
문제 https://codingcompetitions.withgoogle.com/kickstart/round/0000000000436140/000000000068cb14 Kick Start - Google’s Coding Competitions Hone your coding skills with algorithmic puzzles meant for students and those new to coding competitions. Participate in one round or join them all. codingcompetitions.withgoogle.com 나의 풀이 BFS를 사용하면 된다. 핵심은 상자가 많은 칸의 주변을 먼저 채워준다는 것이다. 이를 위해 우선순위 큐를 사용하였다. 생각해보면..
문제 https://codingcompetitions.withgoogle.com/kickstart/round/0000000000436140/000000000068c509#problem Kick Start - Google’s Coding Competitions Hone your coding skills with algorithmic puzzles meant for students and those new to coding competitions. Participate in one round or join them all. codingcompetitions.withgoogle.com 나의 풀이 본 무제는 DP를 사용하는 문제이다. test set 2의 사이즈를 보면 유추할 수 있겠지만 대략 O(R*C) 시간..
문제 https://codingcompetitions.withgoogle.com/kickstart/round/00000000004362d6/00000000008b3a1c Kick Start - Google’s Coding Competitions Hone your coding skills with algorithmic puzzles meant for students and those new to coding competitions. Participate in one round or join them all. codingcompetitions.withgoogle.com 나의 풀이 단순히 brute-force 방식으로 풀면 시간 초과 에러가 난다. 이 문제에서 핵심은 search를 어떻게 효율적으로 할 것인가..
문제 https://codingcompetitions.withgoogle.com/kickstart/round/0000000000435914/00000000008d9a88#problem Kick Start - Google’s Coding Competitions Hone your coding skills with algorithmic puzzles meant for students and those new to coding competitions. Participate in one round or join them all. codingcompetitions.withgoogle.com 나의 풀이 문제가 조금 복잡하지만 구현 자체는 생각보다 단순하다. d = {'R':['R'], 'B':['B'], 'Y':['..
문제 https://codingcompetitions.withgoogle.com/kickstart/round/0000000000435914/00000000008da461 Kick Start - Google’s Coding Competitions Hone your coding skills with algorithmic puzzles meant for students and those new to coding competitions. Participate in one round or join them all. codingcompetitions.withgoogle.com 나의 풀이 단순한 구현 문제이다. 우선 F를 set으로 바꿔주어야 한다. 어차피 우리가 필요한 것은 S에 F의 글자가 있는지만 확인하면 되니..