摘要:
#include<iostream> #define N 5 using namespace std; //回溯法实现N皇后问题 void place(int* x,int n){ for(int i=1;i<N;++i){ int ifPlace=1; for(int j=1;j<N;++j) i 阅读全文
posted @ 2022-10-18 18:10
非遂爻辞
阅读(22)
评论(0)
推荐(0)
摘要:
#include<iostream> using namespace std; //动态规划实现0-1背包客问题 #define C 40 #define MYNUM 10//第0个不算物品,实际有n-1个物品 int m[MYNUM][C]; typedef struct{ int w,v; }E 阅读全文
posted @ 2022-10-18 14:04
非遂爻辞
阅读(28)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<Windows.h> using namespace std; //锦标赛算法求第二大的数(不考虑数组中存在多数等值情况下) typedef struct LNode{ int data; struct LNode *next; }LNode, 阅读全文
posted @ 2022-10-18 00:07
非遂爻辞
阅读(66)
评论(0)
推荐(0)

浙公网安备 33010602011771号