大多数参照我写的上一篇博客,这次多了一些条件
对于0~9的情况,处理方法几乎一样。
对于O,处理方法则略加修改,相当于只能填写2468
E则为13579
对于其他字母,则构建新一些列,表示【A字母,写1,A字母是2,A字母是3 …… Z字母是1,Z字母是2,Z字母是3】
然后把这些列对应上去,直接跑DLX就能AC了。
#include <bits/stdc++.h>
#include <ext/pb_ds/priority_queue.hpp>
#include <tr1/unordered_map>
#include <ctime>
using std::tr1::unordered_map;
using std::sort;
using std::bitset;
using std::max;
using std::cout;
using std::stack;
using std::cin;
using std::endl;
using std::swap;
using std::pair;
using std::vector;
using std::set;
using std::map;
using std::multiset;
using std::queue;
using std::greater;
using std::string;
using std::priority_queue;
using std::max_element;
using std::min_element;
using __gnu_pbds::pairing_heap_tag;
__gnu_pbds::priority_queue