- 博客(7)
- 收藏
- 关注
原创 ZOJ 1038 - T9
用的是map,把相同前缀的词的概率加到一个map里面,找出里面的概率最大的,然后在相同的最大概率中找出字典序最小的. #include #include #include #include #include #include using namespace std; const int b[10][4]={{0},{0},{'a','b','c'},{'d','e','f'},{
2013-01-18 10:11:35 556
原创 UVA 297 - Quadtrees
刚开始以为要用树模拟,后来发现一个数组就可以了 用一个数组存颜色0表示白色1表示黑色,然后两次递归填充一下数组,落在相同位置的就算一个黑色,最后统计一下黑色就可以了 #include #include using namespace std; char pixels[1024]; void fillImage(int depth,char *pixels){ char ch;
2013-01-18 10:09:43 395
原创 UVA 657 - The die is cast
这题的数据有点坑 http://acm.uva.es/board/viewtopic.php?f=7&t=1948&p=205340&hilit=657&sid=379f9c1d7545875d9ac885e9fcb2383f#p205340 这里是讨论版,上面有些刁钻的数据 用了2个函数dfs1,dfs2 dfs2对X进行拓展. 因为数据有可能是这样的:
2013-01-18 10:08:32 558
原创 UVA 705 - Slash Maze
Slash Maze By filling a rectangle with slashes (/) and backslashes ( ), you can generate nice little mazes. Here is an example: As you can see, paths in the maze cannot branch, so the
2013-01-18 10:06:55 440
原创 UVA 532 - Dungeon Master
六个方向的广搜 #include #include #include using namespace std; struct point{ int i,j,z; point(int ii=0,int jj=0,int zz=0):i(ii),j(jj),z(zz){} }; int L,R,C; int tl,tr,tc; char dung[31][31][31];
2013-01-18 10:03:56 351
原创 UVA 10422 - Knights in FEN
BFS+二进制判重 用的是二进制存储状态判重 #include #include #include #include using namespace std; map vis; struct status{ int v,s,x,y;//当前状态值,当前步数,当前状态的空白位置 status(int vv=0,int ss=0,int xx=0,int yy=0):v(vv)
2013-01-18 10:01:31 398
原创 UVA 321 - The New Villa
#include #include #include #include #include using namespace std; int g1[11][11];//房间图 int g2[11][11];//开关图 int r,d,s; map vis; struct status{ vector sche;//步骤 1xx表示开灯 2xx表示关灯 3xx移动 xx表示房间号 最
2013-01-18 10:00:06 487
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人