#include <bits/stdc++.h>
using namespace std;
int a[105][105], s[105][105];
int main() {
int n, m, k;
cin >> n >> m >> k;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
char c;
cin >> c;
a[i][j] = c - '0';
s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + a[i][j];
}
}
int ans = 2e9;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
for (int x = 1; x <= n; x++) {
for (int y = 1; y <= n; y++) {
if (s[x][y] - s[i][y] - s[x][j] + s[i][j] >= k) {
ans = min(ans, s[x][y] - s[i][y] - s[x][j] + s[i][j]);
}
}
}
}
}
if (ans == 2e9) {
cout << 0;
} else {
cout << ans;
}
return 0;
}
明明我有AC的测试点,为什么还会0分?