Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <bits/stdc++.h>using namespace std;using LL = int64_t;using LD = long double;const LL INF = 0x3f3f3f3f;const LL mod = 1e9 + 7;int main() {ios::sync_with_stdio(0);cin.tie(0);int n, m;cin >> n >> m;vector<vector<int>> a(n);for (auto& i : a) {i.resize(m);for (auto& j : i) cin >> j;}auto check = [&](int x, int y) {int sum = a[x][y] + a[x][y + 1] + a[x][y + 2];int tmp = 0;for (int i = 1; i < 3; i++) {tmp = 0;for (int j = 0; j < 3; j++) tmp += a[x + i][y + j];if (tmp != sum) return 0;}for (int i = 0; i < 3; i++) {tmp = 0;for (int j = 0; j < 3; j++) tmp += a[x + j][y + i];if (tmp != sum) return 0;}tmp = 0;