Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- queue
- 하카타역
- 완전탐색
- 후쿠오카 여행경비
- 삼성시험
- 플로이드
- 삼성테스트
- 후쿠오카 4박 5일
- 너비 우선 탐색
- BFS
- DP
- 후쿠오카 캐널시티
- 일본 여행
- 백준
- brute force
- 깊이 우선 탐색
- 완전 탐색
- 다이나믹 프로그래밍
- 후쿠오카 요도바시 하카타
- 미로찾기
- 삼성 SW 테스트
- 큐
- IOS
- 시뮬레이션
- deque
- 알고리즘
- 후쿠오카
- BOJ
- 플로이드 와샬
- dfs
Archives
- Today
- Total
맛있는감귤
BOJ : 1149 RGB거리 본문
문제 : https://www.acmicpc.net/problem/1149
github : https://github.com/JEONG-SEUNGWOOK/BOJ/blob/master/1149.cpp
DP 문제
#include <stdio.h> #include <algorithm> using namespace std; int N; int main(){ scanf("%d",&N); int a, b, c; int temp_a, temp_b, temp_c; scanf("%d %d %d",&a, &b, &c); for(int i=0;i<N-1;i++){ scanf("%d %d %d",&temp_a, &temp_b, &temp_c); temp_a += min(b, c); temp_b += min(c, a); temp_c += min(a, b); a=temp_a; b=temp_b; c=temp_c; } printf("%d",min(min(a,b),c)); return 0; }
'알고리즘 > 백준 알고리즘' 카테고리의 다른 글
BOJ : 1158 조세퍼스 문제 (0) | 2017.01.15 |
---|---|
BOJ : 2276 암기왕 (0) | 2017.01.12 |
BOJ : 1094 막대기 (0) | 2017.01.12 |
BOJ : 1085 직사각형에서 탈출 (0) | 2017.01.12 |
BOJ : 1026 보물 (0) | 2017.01.12 |