Enum:Hopscotch(POJ 3050)】的更多相关文章

跳格子 题目大意:牛像我们一样跳格子,一个5*5的方格,方格有数字,给牛跳5次,可以组成一个6个数字组合字符串,请问能组合多少个字符串? 题目规模很小,暴力枚举,然后用map这个玩具来检测存不存在就可以了,水题 #include <iostream> #include <functional> #include <algorithm> #include <string> #include <map> using namespace std; ][…
POJ 3050 题意: 1.5*5的方阵中,随意挑一格,记住这个格子的数字 2.可以上下左右走,走5次,每走一次记录下所走格子的数字 3.经过以上步骤,把所得6个数字连起来,形成一串数字.求共可以形成多少种不同的数字串 思路: 网格大小只有5*5,用穷举法,不会超时. 这里利用了stl中的set容器来防止重复.最终只要输出set的size就是结果. 注意dfs回溯时的编程规范 #include<iostream> #include<algorithm> #include<s…
E - River Hopscotch POJ - 3258 Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a rock at the start and…
http://poj.org/problem?id=3050 给定一个5×5矩阵,问选6个数的不同排列总数是多少! 二维的搜索,注意要判重,数据量很小,直接用map就好. #include<cstdio> #include<cstring> #include<string> #include<iostream> #include<map> using namespace std; map<string,int>m; ][],ans;…
http://poj.org/problem?id=3050 题目大意: 在一个5*5的格子中走,每一个格子有个数值,每次能够往上下左右走一格,问走了5次后得到的6个数的序列一共同拥有多少种?(一開始站的位置算一个,能够走回去) 思路: 近期我就是在做水题... 直接DFS就可以..我用map推断序列是否反复的. #include<cstdio> #include<cstring> #include<map> #include<string> #includ…
Hopscotch Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2845   Accepted: 1995 Description The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows creat…
The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows create a 5x5 rectilinear grid of digits parallel to the x and y axes.They then adroitly hop onto any digit in…
-->Hopscotch 这接写中文了 Descriptions: 奶牛们以一种独特的方式玩孩子们的跳房子游戏. 奶牛们创造了一个5x5的格子 他们熟练地跳上其中的一个格子,可以前后左右地跳(不能对角)到另一个格子上.之后继续跳(可能跳到曾经跳过的格子上). 他们总共跳5次,路径可以看作一个六位数 (准确的说是一个六位序列,如000201是可行的). 请你找到这样的六位序列的总数 Input * 输入一个5x5的地图 Output * 所有可能六位序列的总数 Sample Input 1 1 1…
Hopscotch Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2774 Accepted: 1940 Description The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows create a…
Hopscotch Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6761   Accepted: 4354 Description The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows creat…