思路
DFS+适当剪枝
参考
PAT (Top Level) Practise 1004 To Buy or Not to Buy - Hard Version (35)
通过画面
代码
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <climits>
#include <algorithm>
using namespace std;
const int N = 1010;
struct bead {
int arr[62], len;
char str[N];
void read(void) {
scanf("%s", str);
return;