夏夜、

心若平似镜、何题不AC。

2014年2月20日

usaco PROB Checker Challenge 搜索

摘要: 搜索的过程中用2进制保存状态,通过位运算判断可行性。//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned long long ull;typedef pair pii;#defin 阅读全文

posted @ 2014-02-20 19:18 BMan、 阅读(219) 评论(0) 推荐(0) 编辑

usaco Superprime Rib 搜索

摘要: 按位搜索//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned long long ull;typedef pair pii;#define pb(a) push(a)#define 阅读全文

posted @ 2014-02-20 18:37 BMan、 阅读(169) 评论(0) 推荐(0) 编辑

usaco Number Triangles DP

摘要: DP入门题。//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned long long ull;typedef pair pii;#define pb(a) push(a)#defi 阅读全文

posted @ 2014-02-20 17:14 BMan、 阅读(194) 评论(0) 推荐(0) 编辑

usaco Arithmetic Progressions

摘要: 预处理全部q2+p2有20000多个。枚举任意两个的差,并以这个差扩展找到连续的有几个为了避免重复浪费时间,只需判断无法向左扩展的一对数,具体见代码。//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typed 阅读全文

posted @ 2014-02-20 16:31 BMan、 阅读(189) 评论(0) 推荐(0) 编辑

usaco the clocks DFS

摘要: 迭代加深搜索,预处理9个move.//#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;typedef unsigned long long ull;typedef pair pii;#define pb(a) p 阅读全文

posted @ 2014-02-20 14:12 BMan、 阅读(174) 评论(0) 推荐(0) 编辑

导航