Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <iostream>#include <cstring>#define MAX_WORD 40using namespace std;int word_hash[MAX_WORD];int word_cnt = 0;int bfs(int hash, int depth, int count){if (depth == word_cnt)return count;int score = bfs(hash, depth + 1, count);if ((hash | word_hash[depth]) == hash + word_hash[depth]){int score2 = bfs(hash | word_hash[depth], depth+1, count +1);if (score2 > score)return score + 1;}return score;}int main(){cin >> word_cnt;