博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【动态规划】装配线调度代码
阅读量:2235 次
发布时间:2019-05-09

本文共 628 字,大约阅读时间需要 2 分钟。

CLRS第二版15.1:

#include 
int f[2][101];int l[2][101];int ff;int ll;void fastest_way(int n, int a[2][n], int t[2][n-1], int e[2], int x[2]){ f[0][0] = a[0][0] + e[0]; f[1][0] = a[1][0] + e[1]; for(int j=1; j
=1; j--) { i = l[i][j]; printf("line %d, station %d\n", i, j); }}int main(){ int a[2][6] = {
{7, 9, 3, 4, 8, 4}, {8, 5, 6, 4, 5, 7}}; int t[2][5] = {
{2, 3, 1, 3, 4}, {2, 1, 2, 2, 1}}; int e[2] = {2, 4}; int x[2] = {3, 2}; fastest_way(6, a, t, e, x); printf("Total cost: %d\n", ff); print_station(6, ll); return 0;}

转载地址:http://mxnbb.baihongyu.com/

你可能感兴趣的文章
【LEETCODE】312-Burst Balloons
查看>>
【LEETCODE】232-Implement Queue using Stacks
查看>>
【LEETCODE】225-Implement Stack using Queues
查看>>
【LEETCODE】155-Min Stack
查看>>
【LEETCODE】20-Valid Parentheses
查看>>
【LEETCODE】290-Word Pattern
查看>>
【LEETCODE】36-Valid Sudoku
查看>>
【LEETCODE】205-Isomorphic Strings
查看>>
【LEETCODE】204-Count Primes
查看>>
【LEETCODE】228-Summary Ranges
查看>>
【LEETCODE】27-Remove Element
查看>>
【LEETCODE】66-Plus One
查看>>
【LEETCODE】26-Remove Duplicates from Sorted Array
查看>>
【LEETCODE】118-Pascal's Triangle
查看>>
【LEETCODE】119-Pascal's Triangle II
查看>>
【LEETCODE】190-Reverse Bits
查看>>
word2vec 模型思想和代码实现
查看>>
怎样做情感分析
查看>>
用深度神经网络处理NER命名实体识别问题
查看>>
用 RNN 训练语言模型生成文本
查看>>