RGB거리[백준] 계단오르기 1149번 #include int min(int first, int second){if (first < second) return first;return second;} int main(){int d[1000][3] = { 0, };int n;int i;int price[3]; scanf("%d", &n); scanf("%d %d %d", &d[0][0], &d[0][1], &d[0][2]); for (i = 1; i < n; i++) {scanf("%d %d %d", &price[0], &price[1], &price[2]); d[i][0] = min(d[i - 1][1], d[i - 1][2]) + price[0];d[i][1] = min(d[i - 1][0], d[i -..
프로그래밍/알고리즘
2017. 3. 19. 01:15