蓝精灵2电影游戏怎样collect 5 puzzle pieces

安全市场联盟开放平台
如果你是应用开发者欢迎提交软件到360
下载的人还喜欢
本类热门应用
蓝精灵拼图
这款游戏包含蓝精灵的卡通形象,共有50个级别。
把图片拖拽到正确的地方来完成图像。
使用选择按钮来预览原始图像。
完成的等级将被解锁,图片可设置成壁纸或者存储到SD卡上。
尝试着去完成所有的关卡,在这个过程中会越来越难。
支持肖像和景观模式。
支持全屏、截屏
App2SD.
保持登录状态
您的赞美就是给作者最大的回报,觉得好就表扬TA一下吧。
还可以输入200字
该应用暂时还没有评论,沙发空缺中。
应用评分:6.0分
这款应用褒贬不一自己试试看吧
请先下载此应用,才可对其评分。
我来评分:
通过360手机卫士检测
安全无毒,可放心下载。
- 有内置广告
- 有插屏广告
需要调用以下重要权限
-&访问网络-&获取网络状态
Copyright&2005- All Rights Reserved 360安全中心您正在使用IE低版浏览器,为了您的雷锋网账号安全和更好的产品体验,强烈建议使用更快更安全的浏览器
发私信给华太师
同步到新浪微博
当月热门文章
为了您的账户安全,请
您的邮箱还未验证,完成可获20积分哟!
您的账号已经绑定,现在您可以以方便用邮箱登录collect the pieces - 必应 词典网络收集零件1.收集零件KET必背热门词... ... fall into sea 掉入海中 collect the pieces 收集零件 become an astronaut in the future 将来变成宇航员 ... |例句释义:全部,收集零件类别:全部,口语,书面语,标题,技术来源:全部,字典,网络难度:全部,简单,中等,难更多例句筛选收起例句筛选1.'m
reforged 2.
would be outside my 7. will
tiny pieces of
fragmented , and
the & behind ,
必应词典应用准确权威无广告下 载 手 机 版 必 应 词 典体 验 P C 版 必 应 词 典ACM_剪枝(11)
ACM_DFS(16)
题目描述:
Little Barborka has just started to learn how to solve a picture puzzle. She has started with a small one containing 15 pieces. Her daddy tries to solve the puzzle too. To make it a little bit harder for himself,
he has turned all puzzle pieces upside down so that he cannot see pictures on the pieces. Now he is looking for a solution of the puzzle. Normally the solution should exist but he is not sure whether Barborka has not replaced some pieces of the puzzle by pieces
of another similar puzzle. Help him and write a program which reads a description of a set of puzzle pieces and decides whether it is possible to assembly the pieces into a rectangle with given side lengths or not.
The input file consists of blocks of lines. Each block except the last describes one puzzle problem. In the first line of the block there are integers&n&and&m,&&separated
by one space. The integers&n,&mindicate
the number of rows and columns in the puzzle respectively. The description of individual puzzle pieces is in the following&&lines
of the block. Each piece is a rectangle 3 centimeters wide and 4 centimeters high with possible juts or cavities in the middle of its sides. For each side of a puzzle piece just one of the following possibilities is true (see picture):
there is no jut or cavity on the side, i.e., the side is flat - such sides can be used only on edges of the final picture when assembling the puzzle,there is one jut in the middle of the side,there is one cavity in the middle of the side.
As is usual, two pieces can be placed side by side only if one has a jut and the other has a cavity on corresponding sides. We will denote the flat sides by&F, the sides with juts by&O&and the
sides with cavities by&I. Each piece is described by four letters characterizing its top, right, bottom, and left side. To make the task easier the pieces can be used only as they are described i.e. they cannot be turned.
After each block there is an empty line. The last block consists of just one line containing 0 0, i.e. two zeros separated by one space.
The output file contains the lines corresponding to the blocks in the input file. A line contains&YES&if the corresponding block in the input file
describes a puzzle that can be correctly assembled. Otherwise it contains&NO. There is no line in the output file corresponding to the last ``null'' block of the input file.
拼图,小碎片有凹有平有凸,让其拼成一个边缘无凹凸的矩形。
DFS+剪枝,注意小碎片的长宽不一样,拼图时长宽要做到一一对应。
1、F的数量要是2*(m+n),即等于矩形的周长,IO的数量要想等,可以更细化小碎片长边的IO和短边的IO要分别相等。
2、关键剪枝,由于碎片是可以有重复构型的,这样dfs会有许多重复碎片而导致冗余路径,所以保证该位置次碎片不可填即预示所有相同构形的碎片都不可填,这里可以对碎片事先分类,即该类碎片不可填 立即换到下一类碎片 而不是下一个碎片。
此题在的时候rejudge了,当初我做的时候,本来使用一维数组存储矩形来做 是WA的,结果换成二维数组存储矩形 然后dfs却AC了,真是百思不得其解,好在后来rejudge了,还是有点坑,浪费3天的时间生成各种数据测试WA程序。
代码一(rejudge后AC,一维存储矩形)
#include &stdio.h&
#include &stdlib.h&
#include &string.h&
#include &iostream&
#include &algorithm&
int n=0,m=0;//n is the row,m is the column
typedef struct kind
/* data */
char piestr[4+5];//all string is same,we need the len++ or len-- to control the string count
memset(piestr,'\0',sizeof(piestr));
kind piekind[100+5];//the kind piece lib
int cntkind=0;//the kind of the count
char puzzle[100+5][4+5]={'\0'};//the puzzle container
string newpuzzle[10][10];//new puzzle container
int cntpie=0;//the ocunt of the piece
int peripie=0;//perimeter of the piece 's side
int flag=0;//yes or no
/*initialize the lib*/
int InitLib()
for(i=0;i&=cntkind-1;i++)
piekind[i].len=0;
cntkind=0;
return(0);
/*insert the piece to the piece lib*/
int insertlib(char GStr[])
int i=0,j=0;
int findflag=0;
for(i=0;i&=cntkind-1;i++)
//find the same kind
if(strcmp(GStr,piekind[i].piestr)==0)
findflag=1;
piekind[i].len++;
if(!findflag)//not find it ,we
will build the new kind for the peikind lib
strcpy(piekind[cntkind].piestr,GStr);
piekind[cntkind].len++;
cntkind++;
return(0);
/*match the touch,the I&O is match
\0&* is match, the if 's order is important*/
bool MatchSide(char a,char b)
if(a=='\0'||b=='\0')
return(true);
//a!='\0' and b!='\0'
if(a=='F'||b=='F')
return(false);
//a!='\0'and'F'
b!='\0'and'F'
return(false);
return(true);
/*judge the string is fit for place it to the position cur*/
bool IsFit(char piestr[],int cur)
//get the first row or mid row or last row,one dimension to the two dimension coordinate
int row=cur/m;
int col=cur%m;
char top=piestr[0],right=piestr[1],bottom=piestr[2],left=piestr[3];
//F problem
if(row==0)//first row,this structure note that the n=1 or m=1 's case
if(!(top=='F'))//the first row must have this condition
return(false);
if(row==n-1)//last row
if(!(bottom=='F'))
return(false);
if(row&0&&row&n-1)//mid row
if(!(top!='F'&&bottom!='F'))
return(false);
if(col==0)//first one
if(!(left=='F'))
return(false);
if(col==m-1)//last one
if(!(right=='F'))
return(false);
if(col&0&&col&m-1)//mid one
if(!(left!='F'&&right!='F'))
return(false);
//I O match problem
//get the neighbour piece
int leftcur=row*m+(col-1);
char lefttop='\0',leftright='\0',leftbottom='\0',leftleft='\0';//init '\0'
if(col&=1)
lefttop=puzzle[leftcur][0];leftright=puzzle[leftcur][1];leftbottom=puzzle[leftcur][2];leftleft=puzzle[leftcur][3];
if(!MatchSide(leftright,left))//cur and the leftcur touch match
return(false);
int topcur=(row-1)*m+
char toptop='\0',topright='\0',topbottom='\0',topleft='\0';//init '\0'
if(row&=1)
{//this {} must be added , because the following line is multiple sentence`
toptop=puzzle[topcur][0];topright=puzzle[topcur][1];topbottom=puzzle[topcur][2];topleft=puzzle[topcur][3];
if(!MatchSide(topbottom,top))//cur and top cur touch match
return(false);
//the I&O is match
\0&* match
return(true);
/*fill this piece to the puzzle*/
int FillPie(int ind,int cur)
strcpy(puzzle[cur],piekind[ind].piestr);
piekind[ind].len--;
return(0);
/*unfill this piece from the puzzle*/
int UnFillPie(int ind,int cur)
piekind[ind].len++;
return(0);
/*DFS the piece*/
int DFS(int cur)
return(0);
if(cur==cntpie)
return(0);
for(i=0;i&=cntkind-1;i++)
if(piekind[i].len&0&&IsFit(piekind[i].piestr,cur))
FillPie(i,cur);
DFS(cur+1);
return(0);
UnFillPie(i,cur);
return(0);
/*for test*/
int test()
return(0);
/*main process*/
int MainProc()
while(scanf(&%d%d&,&n,&m)!=EOF&&(n+m)&0)
int i=0,j=0;
cntpie=n*m;
peripie=m+n+m+n;
int cntF=0,cntI=0,cntO=0;
InitLib();
for(i=0;i&=cntpie-1;i++)
char GStr[4+5]={'\0'};
scanf(&%s&,GStr);
//get the count of F I O
while(GStr[j]!='\0')
switch(GStr[j])
//put into the piekind lib,update the piekind and the cntkind
insertlib(GStr);
//prune the count of F and
if(cntF==peripie&&cntI==cntO)
//NewDFS(0,0);//DFS the piece
printf(&YES\n&);
printf(&NO\n&);
return(0);
int main(int argc, char const *argv[])
/* code */
MainProc();
代码二(AC,二维存储矩阵)
#include &stdio.h&
#include &stdlib.h&
#include &string.h&
#include &iostream&
#include &algorithm&
int n=0,m=0;//n is the row,m is the column
typedef struct kind
/* data */
char piestr[4+5];//all string is same,we need the len++ or len-- to control the string count
memset(piestr,'\0',sizeof(piestr));
kind piekind[100+5];//the kind piece lib
int cntkind=0;//the kind of the count
char puzzle[100+5][4+5]={'\0'};//the puzzle container
string newpuzzle[10][10];//new puzzle container
int cntpie=0;//the ocunt of the piece
int peripie=0;//perimeter of the piece 's side
int flag=0;//yes or no
/*initialize the lib*/
int InitLib()
for(i=0;i&=cntkind-1;i++)
piekind[i].len=0;
cntkind=0;
return(0);
/*insert the piece to the piece lib*/
int insertlib(char GStr[])
int i=0,j=0;
int findflag=0;
for(i=0;i&=cntkind-1;i++)
//find the same kind
if(strcmp(GStr,piekind[i].piestr)==0)
findflag=1;
piekind[i].len++;
if(!findflag)//not find it ,we
will build the new kind for the peikind lib
strcpy(piekind[cntkind].piestr,GStr);
piekind[cntkind].len++;
cntkind++;
return(0);
/*match the touch,the I&O is match
\0&* is match, the if 's order is important*/
bool MatchSide(char a,char b)
if(a=='\0'||b=='\0')
return(true);
//a!='\0' and b!='\0'
if(a=='F'||b=='F')
return(false);
//a!='\0'and'F'
b!='\0'and'F'
return(false);
return(true);
/*IsFit reload*/
bool IsFit(char piestr[],int x,int y)
//get the first row or mid row or last row,one dimension to the two dimension coordinate
int row=x;
int col=y;
char top=piestr[0],right=piestr[1],bottom=piestr[2],left=piestr[3];
//F problem
if(row==0)//first row,this structure note that the n=1 or m=1 's case
if(!(top=='F'))//the first row must have this condition
return(false);
if(row==n-1)//last row
if(!(bottom=='F'))
return(false);
if(row&0&&row&n-1)//mid row
if(!(top!='F'&&bottom!='F'))
return(false);
if(col==0)//first one
if(!(left=='F'))
return(false);
if(col==m-1)//last one
if(!(right=='F'))
return(false);
if(col&0&&col&m-1)//mid one
if(!(left!='F'&&right!='F'))
return(false);
//I O match problem
//get the neighbour piece
char lefttop='\0',leftright='\0',leftbottom='\0',leftleft='\0';//init '\0'
if(col&=1)
lefttop=newpuzzle[row][col-1][0];leftright=newpuzzle[row][col-1][1];leftbottom=newpuzzle[row][col-1][2];newpuzzle[row][col-1][3];
if(!MatchSide(leftright,left))//cur and the leftcur touch match
return(false);
char toptop='\0',topright='\0',topbottom='\0',topleft='\0';//init '\0'
if(row&=1)
{//this {} must be added , because the following line is multiple sentence`
toptop=newpuzzle[row-1][col][0];topright=newpuzzle[row-1][col][1];topbottom=newpuzzle[row-1][col][2];topleft=newpuzzle[row-1][col][3];
if(!MatchSide(topbottom,top))//cur and top cur touch match
return(false);
//the I&O is match
\0&* match
return(true);
/*new DFS*/
int NewDFS(int x,int y)
return(0);
return(0);
NewDFS(x+1,0);
for(i=0;i&=cntkind-1;i++)
if(piekind[i].len&0&&IsFit(piekind[i].piestr,x,y))
piekind[i].len--;
newpuzzle[x][y]=piekind[i].
NewDFS(x,y+1);
return(0);
piekind[i].len++;
return(0);
/*for test*/
int test()
return(0);
/*main process*/
int MainProc()
while(scanf(&%d%d&,&n,&m)!=EOF&&(n+m)&0)
int i=0,j=0;
cntpie=n*m;
peripie=m+n+m+n;
int cntF=0,cntI=0,cntO=0;
InitLib();
for(i=0;i&=cntpie-1;i++)
char GStr[4+5]={'\0'};
scanf(&%s&,GStr);
//get the count of F I O
while(GStr[j]!='\0')
switch(GStr[j])
//put into the piekind lib,update the piekind and the cntkind
insertlib(GStr);
//prune the count of F and
if(cntF==peripie&&cntI==cntO)
NewDFS(0,0);//DFS the piece
printf(&YES\n&);
printf(&NO\n&);
return(0);
int main(int argc, char const *argv[])
/* code */
MainProc();
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:308757次
积分:4360
积分:4360
排名:第5055名
原创:145篇
转载:54篇
评论:85条
(1)(5)(6)(5)(5)(9)(7)(11)(2)(1)(14)(3)(1)(6)(20)(22)(7)(15)(20)(4)(5)(9)(1)(4)(6)(10)

我要回帖

更多关于 蓝精灵游戏 的文章

 

随机推荐