Submission #833325

#TimeUsernameProblemLanguageResultExecution timeMemory
833325vjudge1Exam (eJOI20_exam)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; int n, m; const int maxn = 2504; int prevw; int prevh[maxn]; int main() { cin >> n >> m; int maxpossiblew = maxn; int maxpossibleh = maxn; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { char x; cin >> x; if (x == '1') { prevw++; prevh[j]++; } else { if (prevw > 0) { maxpossiblew = min(maxpossiblew, prevw); } if (prevh[j] > 0) { maxpossibleh = min(maxpossibleh, prevh[j]); } prevw = 0; prevh[j] = 0; } } if (prevw > 0) { maxpossiblew = min(maxpossiblew, prevw); } prevw = 0; } for (int j = 1; j <= m; j++) { if (prevh[j] > 0) maxpossibleh = min(maxpossibleh, prevh[j]); } cout << maxpossibleh * maxpossiblew << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...