September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -63,7 +63,7 @@ void max_penalty(int len1, int len2, bool is_row, int res[4]) {
|
|||
void next_cell(int res[4]) {
|
||||
int i, res1[4], res2[4];
|
||||
max_penalty(N_ROWS, N_COLS, TRUE, res1);
|
||||
max_penalty(N_COLS, N_COLS, FALSE, res2);
|
||||
max_penalty(N_COLS, N_ROWS, FALSE, res2);
|
||||
|
||||
if (res1[3] == res2[3]) {
|
||||
if (res1[2] < res2[2])
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define N_ROWS 5
|
||||
#define N_COLS 5
|
||||
|
||||
typedef int bool;
|
||||
|
||||
int supply[N_ROWS] = { 461, 277, 356, 488, 393 };
|
||||
int demand[N_COLS] = { 278, 60, 461, 116, 1060 };
|
||||
|
||||
int costs[N_ROWS][N_COLS] = {
|
||||
{ 46, 74, 9, 28, 99 },
|
||||
{ 12, 75, 6, 36, 48 },
|
||||
{ 35, 199, 4, 5, 71 },
|
||||
{ 61, 81, 44, 88, 9 },
|
||||
{ 85, 60, 14, 25, 79 }
|
||||
};
|
||||
|
||||
// etc
|
||||
|
||||
int main() {
|
||||
// etc
|
||||
|
||||
printf(" A B C D E\n");
|
||||
for (i = 0; i < N_ROWS; ++i) {
|
||||
printf("%c", 'V' + i);
|
||||
for (j = 0; j < N_COLS; ++j) printf(" %3d", results[i][j]);
|
||||
printf("\n");
|
||||
}
|
||||
printf("\nTotal cost = %d\n", total_cost);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue