回溯 #include <iostream> #include <unordered_map> using namespace std; const int MAX_LEN = 11; const int UN_VISITED = 0; const int VISITED = 1; int ans = 0; int max_sum = 0; void backtrack(int index, int *w, int *cnt, int len, unordered_map<int, char> &map, int sum) { ...