亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pku2612.txt

?? 北京大學 在線acm在線判題系統 一些題目解答
?? TXT
字號:
Mine Sweeper 
Time Limit:1000MS  Memory Limit:65536K
Total Submit:1921 Accepted:761 

Description
The game Minesweeper is played on an n by n grid. In this grid are hidden m mines, each at a distinct grid location. The player repeatedly touches grid positions. If a position with a mine is touched, the mine explodes and the player loses. If a positon not containing a mine is touched, an integer between 0 and 8 appears denoting the number of adjacent or diagonally adjacent grid positions that contain a mine. A sequence of moves in a partially played game is illustrated below. 
 
Here, n is 8, m is 10, blank squares represent the integer 0, raised squares represent unplayed positions, and the figures resembling asterisks represent mines. The leftmost image represents the partially played game. From the first image to the second, the player has played two moves, each time choosing a safe grid position. From the second image to the third, the player is not so lucky; he chooses a position with a mine and therefore loses. The player wins if he continues to make safe moves until only m unplayed positions remain; these must necessarily contain the mines. 

Your job is to read the information for a partially played game and to print the corresponding board. 


Input
The first line of input contains a single postitive integer n <= 10. The next n lines represent the positions of the mines. Each line represents the contents of a row using n characters: a period indicates an unmined positon while an asterisk indicates a mined position. The next n lines are each n characters long: touched positions are denoted by an x, and untouched positions by a period. The sample input corresponds to the middle figure above.

Output
Your output should represent the board, with each position filled in appropriately. Positions that have been touched and do not contain a mine should contain an integer between 0 and 8. If a mine has been touched, all positions with a mine should contain an asterisk. All other positions should contain a period. 

Sample Input


8
...**..*
......*.
....*...
........
........
.....*..
...**.*.
.....*..
xxx.....
xxxx....
xxxx....
xxxxx...
xxxxx...
xxxxx...
xxx.....
xxxxx...


Sample Output


001.....
0013....
0001....
00011...
00001...
00123...
001.....
00123...


Source
Waterloo local 1999.10.02


Source

Problem Id:2612  User Id:Drizzle 
Memory:184K  Time:30MS
Language:G++  Result:Accepted

Source 

#include <iostream>
#include <cstring>

using namespace std;

int n;
char map[11][11];
char touch[11][11];
int result[11][11];
bool visited[11][11];
bool touched = false;

const int delta[8][2] = 
{
	{-1, 1}, {0, 1},{1, 1},
	{-1, 0}, {1, 0},
	{-1, -1},{0, -1}, {1, -1}
};

void Output()
{
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < n; j++)
		{
			if(touched && map[i][j] == '*')
			{
				cout << '*';
				continue;
			}

			if(touch[i][j] == 'x')
			{
				cout << result[i][j];
			}
			else
			{

					cout << ".";
			}
		}
		cout << endl;
	}
}

bool InRange(int x, int y)
{
	return x >= 0 && x < n && y >= 0 && y < n;
}

void Calc(int x, int y)
{
	for(int i = 0; i < 8; i++)
	{
		int xx = x + delta[i][0];
		int yy = y + delta[i][1];
		if(InRange(xx, yy) && map[xx][yy] == '*')
			result[x][y]++;
	}
}

void Go()
{
	int i, j;
	for(i = 0; i < n; i++)
	{
		for(j = 0; j < n; j++)
		{
			if(touch[i][j] == 'x')
			{
				if(map[i][j] == '*')
				{
					touched = true;
					result[i][j] = -1;
				}
				else
				{
					Calc(i, j);
				}
			}
		}
	}
}



int main()
{
	int i, j;
	memset(result, 0, sizeof(result));
	memset(visited, false, sizeof(visited));
	cin >> n;
	for(i = 0; i < n; i++)
	{
		for(j = 0; j < n; j++)
			cin >> map[i][j];
	}
	for(i = 0; i < n; i++)
	{
		for(j = 0; j < n; j++)
			cin >> touch[i][j];
	}
	Go();
	Output();

	return 0;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天综合网天天看片| 美女任你摸久久| 丁香激情综合五月| 久久久777精品电影网影网 | 国v精品久久久网| 中文字幕 久热精品 视频在线| 韩国av一区二区| 国产日韩欧美a| 99综合电影在线视频| 亚洲三级电影网站| 欧美精品日韩一区| 精品一区二区免费在线观看| 国产女人水真多18毛片18精品视频 | 色女孩综合影院| 一区二区三区欧美日| 欧美电影一区二区| 国产麻豆精品在线| 亚洲人成伊人成综合网小说| 欧美喷水一区二区| 精品亚洲成a人| 亚洲情趣在线观看| 欧美一二三四区在线| 国产精品亚洲人在线观看| 自拍偷拍欧美精品| 欧美一级理论性理论a| 国产不卡一区视频| 亚洲福利国产精品| 久久久欧美精品sm网站| 91麻豆国产自产在线观看| 视频一区二区不卡| 国产精品久久久爽爽爽麻豆色哟哟 | 亚洲欧美色一区| 日韩欧美国产电影| 91丨九色丨尤物| 毛片av一区二区| 亚洲欧美日韩在线播放| 日韩三级视频中文字幕| 成人免费福利片| 视频在线在亚洲| 亚洲视频在线一区观看| 日韩午夜av电影| 一本久道久久综合中文字幕 | 国产精品中文字幕日韩精品| 一区二区三区四区视频精品免费| 日韩视频永久免费| 色噜噜狠狠色综合欧洲selulu| 韩国精品主播一区二区在线观看 | 亚洲丝袜另类动漫二区| 精品女同一区二区| 欧美日韩国产精选| 成人av网址在线| 国产尤物一区二区| 精品一区免费av| 亚洲图片一区二区| 亚洲欧洲日产国码二区| 久久无码av三级| 538在线一区二区精品国产| 91美女精品福利| 成人免费视频播放| 国产丶欧美丶日本不卡视频| 日本网站在线观看一区二区三区| 亚洲男人天堂av网| 欧美激情一区二区三区| 久久综合色之久久综合| 欧美一区二区三区在线| 欧美日韩日日摸| 欧美午夜电影一区| 91国偷自产一区二区三区观看 | 日韩欧美在线1卡| 欧美人与z0zoxxxx视频| 欧美图区在线视频| 一本大道久久a久久综合 | 在线亚洲一区二区| 91小视频在线| 99久久久无码国产精品| 成人av电影免费观看| 成人午夜激情视频| 成人精品电影在线观看| 成人黄色一级视频| aaa亚洲精品| 91色在线porny| 一本一道久久a久久精品综合蜜臀| 99视频有精品| 在线观看欧美黄色| 欧美日韩免费视频| 欧美一级黄色片| 日韩美女天天操| 久久久久亚洲综合| 国产欧美一区二区精品性| 国产精品色噜噜| 亚洲私人影院在线观看| 亚洲一区二区三区激情| 日韩激情av在线| 久久99精品久久久| 国产91色综合久久免费分享| 成人黄色软件下载| 欧美在线不卡一区| 欧美福利视频一区| 久久免费国产精品| 成人欧美一区二区三区在线播放| 亚洲美女电影在线| 午夜精品视频一区| 久久99精品久久久久婷婷| 国产馆精品极品| 国产亚洲精品aa午夜观看| 中文字幕免费一区| 亚洲综合一区在线| 狠狠色综合播放一区二区| 岛国一区二区三区| 欧美性受xxxx黑人xyx| 精品蜜桃在线看| 国产精品国产a级| 日韩精品一级二级 | 日本一区二区免费在线观看视频| 亚洲欧洲国产日韩| 奇米影视在线99精品| 国产成人鲁色资源国产91色综 | 色综合久久综合中文综合网| 在线不卡中文字幕播放| 国产拍欧美日韩视频二区| 亚洲一区在线观看视频| 国产一二三精品| 欧美手机在线视频| 久久久精品综合| 亚洲午夜精品久久久久久久久| 激情五月婷婷综合网| 在线免费不卡电影| 久久精品综合网| 日韩avvvv在线播放| av网站免费线看精品| 日韩情涩欧美日韩视频| 亚洲人快播电影网| 国产乱人伦精品一区二区在线观看 | 中文字幕一区在线| 久久精品国产秦先生| 色播五月激情综合网| 久久久亚洲高清| 麻豆精品一区二区三区| 日本精品视频一区二区| 国产欧美日韩麻豆91| 日本视频一区二区三区| 欧美一a一片一级一片| 国产色综合一区| 久久国产成人午夜av影院| 欧美日韩精品系列| 依依成人综合视频| 波多野结衣中文字幕一区 | 色婷婷av一区二区三区大白胸| 欧美精品一区二区三区在线 | 亚洲国产精品ⅴa在线观看| 午夜不卡av免费| 91久久精品国产91性色tv| 国产欧美日本一区视频| 国产综合色精品一区二区三区| 欧美一区二区三区视频在线 | 日本一区二区三区四区| 伦理电影国产精品| 欧美一级二级三级蜜桃| 一区二区三区精品在线观看| 99精品热视频| 国产精品污网站| 国产成人在线色| 国产亚洲va综合人人澡精品| 极品少妇一区二区| 91精品国产欧美一区二区18| 天天综合色天天综合| 欧美日本国产视频| 午夜视频久久久久久| 欧美日韩中文另类| 五月婷婷激情综合| 欧美精品久久一区二区三区| 午夜国产不卡在线观看视频| 欧美精品一二三四| 日本不卡一二三区黄网| 日韩一区二区三区四区| 免费成人在线播放| 日韩免费视频一区| 国产一区欧美日韩| 中文字幕精品在线不卡| 成人av网址在线观看| 亚洲精品久久久久久国产精华液| 91免费精品国自产拍在线不卡| 日本一区二区三区电影| 91女人视频在线观看| 亚洲高清免费在线| 日韩美一区二区三区| 国产麻豆精品在线| 国产精品二三区| 欧美无砖专区一中文字| 日本美女视频一区二区| www日韩大片| 91美女在线观看| 婷婷国产在线综合| 久久久亚洲综合| 成人黄色a**站在线观看| 亚洲欧美一区二区久久| 欧美美女网站色| 国产美女在线精品| 亚洲欧美另类久久久精品| 欧美乱熟臀69xxxxxx|