- 博客(7)
- 收藏
- 关注
原创 POJ3083 Children of the Candy Corn(DFS + BFS)
DFS求左贴墙和右贴墙 BFS求最短路 我用的方向顺序是 上=0 右=1 下=2 左=3 注意要贴墙走,详细见代码 #include #include #include #include #include #include using namespace std; const int maxn = 40 + 5; const int INF = ~0U >> 1; const i
2015-10-25 17:18:01 305
原创 sg函数模板
///f[]:可以取走的石子个数 ///sg[]:0~n的SG函数值 ///hash[]:mex{} int f[K],sg[N],hash[N]; void getSG(int n) { memset(sg,0,sizeof(sg)); for(int i = 1; i <= n; ++i) { memset(hash,0,sizeof(hash));
2015-10-16 22:33:45 320
原创 UVa1262 - Password
不知道哪错了。。0.0 #include #include #include #include #include #include using namespace std; const int INF = ~0U >> 1; const int maxn = 7; char s1[maxn][maxn], s2[maxn][maxn]; string str[maxn]; int T
2015-10-08 21:49:45 364
原创 UVA808 - Bee Breeding
参考某神牛的解题思路。。orz #include #include #include #include #include #include #include using namespace std; const int INF = ~0U >> 1; const int maxn = 30000+10; const int nx[] = {-1, 0, 1, 1, 0}; cons
2015-10-08 20:06:03 1078
原创 UVA1641 - ASCII Area
其实思路很简单的。。一行一行的扫,在两个/ \之间的点就是黑色要求的 #include #include #include #include #include #include using namespace std; const int INF = ~0U >> 1; const int maxn = 100+5; int m, n; char str[maxn][maxn];
2015-10-07 19:39:18 420
原创 UVA11971 - Polygon
这题会爆int 导致RE。 #include #include #include #include #include #include #include using namespace std; const int INF = ~0U >> 1; const double eps = 1e-8; const double pi = acos(-1.0); typedef long
2015-10-07 18:57:41 397
原创 uva 10801 - Lift Hopping
裸最短路算法 一开始因为k=0的情况应该输出0而错了几遍、 #include #include #include #include #include #include #include using namespace std; const int maxn = 100+5; const int INF = ~0U >> 1; struct node { int from,
2015-10-05 21:06:47 315
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人