摘要: 题意:从一种状态通过若干个需要能量操作转换成力另一种状态所需最少的能量。一开始以为是位DP,后来发现位数(20)位太多,只能广度搜索,偷了一下懒,直接用优先队列,一开始没用pair,只保存状态,WA了3次。pair的大小是先比较first再比较second#include<cstdio>#include<cstring>#include<queue>#include<utility>#include<vector>using namespace std;typedef pair<int , int> Word ;int o 阅读全文
posted @ 2012-05-12 16:31 蚀 阅读(427) 评论(0) 推荐(0) 编辑