日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

SDNU 1507.E.The Binding of Isaac

發(fā)布時間:2024/4/15 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SDNU 1507.E.The Binding of Isaac 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Description

?

Ok,?now?I?will?introduce?this?game?to?you...

Isaac?is?trapped?in?a?maze?which?has?many?common?rooms…

Like?this…There?are?9?common?rooms?on?the?map.

?

And?there?is?only?one?super-secret?room.?We?can’t?see?it?on?the?map.?The?super-secret?room?always?has?many?special?items?in?it.?Isaac?wants?to?find?it?but?he?doesn’t?know?where?it?is.Bob?
tells?him?that?the?super-secret?room?is?located?in?an?empty?place?which?is?adjacent?to?only?one?common?rooms.?
Two?rooms?are?called?adjacent?only?if?they?share?an?edge.?But?there?will?be?many?possible?places.

?

Now?Isaac?wants?you?to?help?him?to?find?how?many?places?may?be?the?super-secret?room.

Input

Multiple?test?cases.?The?first?line?contains?an?integer?T?(T<=3000),?indicating?the?number?of?test?case.
Each?test?case?begins?with?a?line?containing?two?integers?N?and?M?(N<=100,?M<=100)?indicating?the?number
of?rows?and?columns.?N?lines?follow,?“#”?represent?a?common?room.?“.”?represent?an?empty?place.Common?rooms?
maybe?not?connect.?Don’t?worry,?Isaac?can?teleport.

Output

?One?line?per?case.?The?number?of?places?which?may?be?the?super-secret?room.

Sample Input

2 5 3 ..# .## ##. .## ##. 1 1 #

Sample Output

8 4 /// /// _ooOoo_ /// o8888888o /// 88" . "88 /// (| -_- |) /// O\ = /O /// ____/`---'\____ /// .' \\| |// `. /// / \\||| : |||// \ /// / _||||| -:- |||||- \ /// | | \\\ - /// | | /// | \_| ''\---/'' | | /// \ .-\__ `-` ___/-. / /// ___`. .' /--.--\ `. . __ /// ."" '< `.___\_<|>_/___.' >'"". /// | | : `- \`.;`\ _ /`;.`/ - ` : | | /// \ \ `-. \_ __\ /__ _/ .-` / / /// ======`-.____`-.___\_____/___.-`____.-'====== /// `=---=' /// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /// Buddha Bless, No Bug ! /// #include <cstdio> #include <iostream> #include <string> #include <cstring> #include <cmath> #include <algorithm> #include <queue> #include <vector> #include <map> using namespace std; #define ll long long const int mod = 1e9+7;int t, n, m, sum, mov[4][2] = {0,1, 0,-1, 1,0, -1,0}; char fig[200+8][200+8];int main() {for(scanf("%d", &t); t--; ){scanf("%d%d", &n, &m);getchar();sum = 0;for(int i = 0; i <= n+1; i++)for(int j = 0; j <= m+1; j++)fig[i][j] = '.';for(int i = 1; i <= n; i++){scanf("%s", fig[i]+1);getchar();}for(int i = 0; i <= n+1; i++)///后來總是無法消去回車鍵,所以要另外補充 '.'fig[i][m+1] = '.';for(int i = 0; i <= n+1; i++){for(int j = 0; j <= m+1; j++){int num = 0;if(fig[i][j] == '.'){for(int k = 0; k<4; k++){int buffer_x, buffer_y;buffer_x = i+mov[k][0];buffer_y = j+mov[k][1];if(buffer_x >= 0 && buffer_x <= n+1 && buffer_y >= 0 && buffer_y <= m+1 && fig[buffer_x][buffer_y] == '#')num++;}if(num == 1)sum++;}}}printf("%d\n", sum);}return 0; }

?

?

轉載于:https://www.cnblogs.com/RootVount/p/11237911.html

總結

以上是生活随笔為你收集整理的SDNU 1507.E.The Binding of Isaac的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。