#include <cstring> #include <iostream> using namespace std; const int M = 105, N = 25; int m, n, p[N]; struct node { int cur, num, start; //当前剩余总值,已经选取的邮票数,下次开始遍历邮票的索引; } q[M * M]; int bfs(int sum) { //初始化队列 int hh = 0, tt = -1; q[++tt] = {sum, 0, 0}; while (tt >= hh) { node t = q[hh+...