10 2021 档案

摘要:1、dp数组的含义 maxDP[i]中存储 以nums[i]为结尾元素的子数组的最大乘积minDP[i]中存储 以nums[i]为结尾元素的子数组的最小乘积 注意到:maxDP[i] >= minDP[i] for all i from 0 to nums.size()-1 2、根据maxDP[i] 阅读全文
posted @ 2021-10-30 22:02 corsican 阅读(86) 评论(0) 推荐(0)
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 4 #define VERTEX 5 5 #define INF 99999 6 #define NIL -1 7 8 void print_all_pairs_shortest_path(int pi[][V 阅读全文
posted @ 2021-10-28 21:11 corsican 阅读(101) 评论(0) 推荐(0)
摘要:#include <stdio.h> #define N 4 enum bool {TRUE, FALSE}; void print_Q(int *Q) { int i; for (i = 1; i <= N; i++) printf("%d, ", Q[i]); printf("\n"); } v 阅读全文
posted @ 2021-10-26 14:57 corsican 阅读(65) 评论(0) 推荐(0)
摘要:1 #include <stdio.h> 2 #define LEN 10 3 #define NEGINF -999999 4 struct r_d { 5 int r; //profit 6 int s; //distance 7 }; 8 9 int price[LEN+1] = {0, 1, 阅读全文
posted @ 2021-10-26 14:56 corsican 阅读(74) 评论(0) 推荐(0)
摘要:#include <stdio.h> #define INFINITY 999999 #define LEN(A) ((sizeof (A)) / (sizeof A[0])) void print_array(int A[], int len) { int i; /* int len = LEN( 阅读全文
posted @ 2021-10-24 21:34 corsican 阅读(72) 评论(0) 推荐(0)