poj3050】的更多相关文章

POJ2718 Smallest Difference Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6509   Accepted: 1773 Description Given a number of distinct decimal digits, you can form one integer by choosing a non-empty subset of these digits and writing…
#include <stdio.h> const int MAXN = 10; const int dir[4][2] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1} }; int map[MAXN][MAXN]; int have[1000100],d[6]; int total; void dfs(int x, int y, int step) { if(step == 6) { int num=0; for(int k=0;k<6;k++) { num=n…
#include <stdio.h> #include <set> #include <string> using namespace std; int a[6]; int b[6]; int c[100000000]; //注意是重点,你定义的数字必须的比你的num大,要不会报错的 int h=0; int grid[5][5]; //输入的网格 int go[4][2] = { 0, 1, 0, -1, 1, 0, -1, 0 }; //四个方向 int safe(…
Hopscotch Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2113   Accepted: 1514 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…
一.题目 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 5x5 rectilinear grid of digits parallel to the x and y axes.  They then adroitly hop…
原题链接:http://poj.org/problem?id=3050 (一些文字过会儿再说现在有事儿) #include <cstdio> #include <set> using namespace std; int a[7][7],dx[]={317,0,0,1,-1},dy[]={318,1,-1,0,0};//4个方向 set<int>ans;//答案 void dfs(int x,int y,int d,int n)//x和y是坐标.d是深度,也就是长度.n…
Hopscotch Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4385   Accepted: 2924 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…
题意: 5*5的矩阵里,某个点能够上下左右走,走5步,然后路径会形成一个串,问你,这个5*5里面能够形成多少个不同个串. 思路: 直接暴搜,然后对于一个串塞到set里去,然后输出set里的个数就好了 #include<cstdio> #include<map> #include<set> #include<string> #include<queue> #include<math.h> #include<string.h>…
思路: 水题. 实现: #include <iostream> #include <cstdio> #include <set> using namespace std; ][]; ] = { , , , - }; ] = { , , -, }; ]; ]; void dfs(int x, int y, int d) { ) { ; ; i < ; i++) { tmp += now[i]; ) tmp *= ; } vis[tmp] = true; return…
-->Hopscotch 这接写中文了 Descriptions: 奶牛们以一种独特的方式玩孩子们的跳房子游戏. 奶牛们创造了一个5x5的格子 他们熟练地跳上其中的一个格子,可以前后左右地跳(不能对角)到另一个格子上.之后继续跳(可能跳到曾经跳过的格子上). 他们总共跳5次,路径可以看作一个六位数 (准确的说是一个六位序列,如000201是可行的). 请你找到这样的六位序列的总数 Input * 输入一个5x5的地图 Output * 所有可能六位序列的总数 Sample Input 1 1 1…