摘要:
#include <iostream> using namespace std; // 城市数量 #define N 4 //背包空间 #define R 5 int value[N] = {2, 4, 4, 5}; int weigh[N] = {1, 2, 3, 4}; // #define N 阅读全文
posted @ 2024-05-30 11:45
CV小能手chh
阅读(9)
评论(0)
推荐(0)
摘要:
思路看书 #include <iostream> using namespace std; // 城市数量 #define N 4 // 课本例题 int dis[N][N] = {{0, 3, 6, 7}, {5, 0, 2, 3}, {6, 4, 0, 2}, {3, 7, 5, 0}}; // 阅读全文
posted @ 2024-05-30 11:38
CV小能手chh
阅读(7)
评论(0)
推荐(0)
摘要:
看注释 #include <iostream> #include <cstdlib> #include <ctime> #include <iomanip> using namespace std; #define N 4 #define MAX 0x3f3f3f3f int dp[N][1 << 阅读全文
posted @ 2024-05-30 11:31
CV小能手chh
阅读(5)
评论(0)
推荐(0)
摘要:
这里使用二进制位表示城市集合,思路看书去吧 #include <iostream> #include <cstdlib> #include <ctime> #include <iomanip> #include <bitset> using namespace std; #define N 4//矩 阅读全文
posted @ 2024-05-30 11:18
CV小能手chh
阅读(7)
评论(0)
推荐(0)

浙公网安备 33010602011771号