﻿NBUT 1016 缙云烧饼-Ocrosoft

# NBUT 1016 缙云烧饼

Time Limit:1000MS     Memory Limit:65535KB     64bit IO Format:%I64d & %I64u

Description

```  ****
******
******
******
******
****```

```  ****
******
*******
******
******
****```

Input

Output

Sample Input

```8 14
dfiwoejkfjldjs
dsfj****lskdfk
---******dsjlk
234******3442k
ifo******jkjfk
eou******eow**
jfld****324jkj
jkfjk93fj***fk```

Sample Output

`1`

Solution

```有毒。
#include <set>
#include <map>
#include <list>
#include <cmath>
#include <stack>
#include <queue>
#include <ctime>
#include <string>
#include <cstdio>
#include <vector>
#include <cctype>
#include <climits>
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <functional>
#define strend string::npos
#define ms(a) memset(a,0,sizeof(a))
#define  rep(a,v,b) for(int a=v;a<b;a++)
#define  repe(a,v,b) for(int a=v;a<=b;a++)
typedef long long LL;
const int INF = INT_MAX / 2;
const int MAXN = 300000+ 10;
const int MOD = 1000000009;
int gcd(int a, int b)
{
if (!b)return a;
return gcd(b, a%b);
}
/*(◕‿‿◕)(◕‿‿◕) (◕‿‿◕) (◕‿‿◕) (◕‿‿◕) (◕‿‿◕)*/
/*(◕‿‿◕) 签订契约,成为马猴烧酒吧 (◕‿‿◕)*/
/*(◕‿‿◕)(◕‿‿◕) (◕‿‿◕) (◕‿‿◕) (◕‿‿◕) (◕‿‿◕)*/
using namespace std;
int n,m;
char mp[1200][1200];
int main()
{
while(cin>>n>>m)
{
rep(i,0,n)cin>>mp[i];
int ans=0;
rep(i,0,n)
{
rep(j,0,m)
{
if(mp[i][j]=='*')
{
if(mp[i-1][j]=='*'||mp[i-1][j+1]=='*'||mp[i-1][j+2]=='*'||mp[i-1][j+3]=='*'||mp[i][j-1]=='*'||mp[i][j+4]=='*'||
mp[i+1][j-2]=='*'||mp[i+1][j+5]=='*'||
mp[i+2][j-2]=='*'||mp[i+2][j+5]=='*'||
mp[i+3][j-2]=='*'||mp[i+3][j+5]=='*'||
mp[i+4][j-2]=='*'||mp[i+4][j+5]=='*'||
mp[i+6][j]=='*'||mp[i+6][j+1]=='*'||mp[i+6][j+2]=='*'||mp[i+6][j+3]=='*'||mp[i+5][j-1]=='*'||mp[i+5][j+4]=='*')
continue;

if(mp[i][j]=='*'&&mp[i][j+1]=='*'&&mp[i][j+2]=='*'&&mp[i][j+3]=='*'&&
mp[i+1][j-1]=='*'&&mp[i+1][j]=='*'&&mp[i+1][j+1]=='*'&&mp[i+1][j+2]=='*'&&mp[i+1][j+3]=='*'&&mp[i+1][j+4]=='*'&&
mp[i+2][j-1]=='*'&&mp[i+2][j]=='*'&&mp[i+2][j+1]=='*'&&mp[i+2][j+2]=='*'&&mp[i+2][j+3]=='*'&&mp[i+2][j+4]=='*'&&
mp[i+3][j-1]=='*'&&mp[i+3][j]=='*'&&mp[i+3][j+1]=='*'&&mp[i+3][j+2]=='*'&&mp[i+3][j+3]=='*'&&mp[i+3][j+4]=='*'&&
mp[i+4][j-1]=='*'&&mp[i+4][j]=='*'&&mp[i+4][j+1]=='*'&&mp[i+4][j+2]=='*'&&mp[i+4][j+3]=='*'&&mp[i+4][j+4]=='*'&&
mp[i+5][j]=='*'&&mp[i+5][j+1]=='*'&&mp[i+5][j+2]=='*'&&mp[i+5][j+3]=='*')
ans++;
}
}
}
printf("%d\n",ans);
}
return 0;
//1
}
```