Lang:G++
Edit12345678910111213141516171819202122232425262728293031#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';}