摘要: hash。 怎么感觉叫状态压缩bfs比较合适呢? #include #include #include using namespace std; const int maxn = 10 + 5; const int maxm = 100 + 10; const int maxg = 1024 + 10; bool st[maxn],h[maxg]; int mp[maxm][maxn]... 阅读全文
posted @ 2016-05-29 11:26 invoid 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 单调队列 用一个堆维护目前每个颜色在里面的点,每回取出队首点,并更新答案。一旦哪个颜色的点都被用完,跳出循环。 #include #include #include #include using namespace std; const int maxn = 1000000 + 10; const int maxk = 60+10; struct data { int a,c;... 阅读全文
posted @ 2016-05-29 00:50 invoid 阅读(237) 评论(0) 推荐(0) 编辑