hiho week 222 register

Ended

Participants:151

Verdict:Accepted
Score:100 / 100
Submitted:2018-09-30 11:42:24

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<bits/stdc++.h>
using namespace std;
bool mat[505][505];
int n;
int ser(int x, int y)
{
    int ret = 0;
    int ans = ret + 1;
    while (x - ans && x + ans <= n && y - ans && y + ans <= n)
    {
        if (mat[x - ans][y] && mat[x + ans][y] && mat[x][y + ans] && mat[x][y - ans])
        {
            ret = ans;
            ans++;
            continue;
        }
        break;
    }
    return ret;
}
int main()
{
    scanf("%d", &n);
    char s[505];
    for (int i = 1; i <= n; i++)
    {
        scanf("%s", s + 1);
        for (int j = 1; j <= n; j++)
        {
            mat[i][j] = s[j] - '0';
        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX