HDU5546 Ancient Go DFS】的更多相关文章

点击打开链接 题意:给定一个9*9的棋盘,问黑子能否在下一步将白子围住(四面). 由于数据不大,可以直接将'.'换成'x',用DFS搜索. #include<cstdio> #include<cstring> using namespace std; char chess[11][11]; bool visit[11][11]; int turnx[4]={1,-1,0,0}; int turny[4]={0,0,1,-1}; int flag; bool in(int x,int…
K - Ancient Messages Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Practice UVA 1103 Appoint description:   Description In order to understand early civilizations, archaeologists often study texts written in anc…
G - Ancient Go Description Yu Zhou likes to play Go with Su Lu. From the historical research, we found that there are much difference on the rules between ancient go and modern go. Here is the rules for ancient go they were playing: The game is playe…
In order to understand early civilizations, archaeologists often study texts written in ancient languages. One such language, used in Egypt more than 3000 years ago, is based on characters called hieroglyphs. Figure C.1 shows six hieroglyphs and thei…
题目大意:给出一幅画,找出里面的象形文字. 要你翻译这幅画,把象形文字按字典序输出. 思路:象形文字有一些特点,分别有0个圈.1个圈.2个圈...5个圈.然后dfs或者bfs,就像油井问题一样,找出在同一块的0,找出在同一块的1,分别标上记号. 对于每个同一块的1,如果它们只和1个‘0’的块相邻,就表明这个象形文字没有圈.如果和2个‘1’的块相邻,就说明这个象形文字有一个圈.依此类推...和6个‘1’块相邻的就有五个圈. 最后统计一下每个象形文字和多少不同的块相邻,排一个序,输出. 要注意的是,…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5546 题意就是两个人下围棋,问在下一颗x是否能杀死o,'.'是空位子: 枚举所有的点,判断是否合法即可: #include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <vector> #include <algorithm> #…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5546 AC代码: #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #include<cmath> #includ…
Ancient Printer Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 1803 Accepted Submission(s): 887 Problem DescriptionThe contest is beginning! While preparing the contest, iSea wanted to print the…
Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 110290    Accepted Submission(s): 29967 Problem Description The doggie found a bone in an ancient maze, which fascinated him a…
Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 82702    Accepted Submission(s): 22531 Problem Description The doggie found a bone in an ancient maze, which fascinated him a…