Submission #38385

#TimeUsernameProblemLanguageResultExecution timeMemory
38385Just_Solve_The_ProblemBomb (IZhO17_bomb)C++11
2 / 100
1000 ms14272 KiB
#include <bits/stdc++.h> using namespace std; const int N = (int)2505; char c[N][N]; char ex[N][N]; main () { bool fl = 1; int n, m; scanf ("%d %d", &n, &m); for (int i = 1; i < N; i++) for (int j = 1; j < N; j++) c[i][j] = '0'; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { char ss; ss = getchar(); if (ss == '\n') j--; else { c[i][j] = ss; if (ss == '1') fl = 0; } } } if (fl) { puts("0"); return 0; } int ans = 0; for (int h = 1; h <= n; h++) { for (int w = 1; w <= m; w++) { for (int i = 1; i <= n + 1; i++) for (int j = 1; j <= m + 1; j++) ex[i][j] = c[i][j]; bool can = 1; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { can = 1; for (int curi = i, k = 0; k < h; k++, curi++) { for (int curj = j, l = 0; l < w; l++, curj++) { if (ex[curi][curj] == '0') { can = 0; l = w; k = h; } } } if (can) { for (int curi = i, k = 0; k < h; k++, curi++) { for (int curj = j, l = 0; l < w; l++, curj++) { if (ex[curi][curj] == '1') ex[curi][curj] = '2'; } } } } } can = 1; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (ex[i][j] == '1') can = 0; } } if (can) ans = max(ans, h * w); } } cout << ans; }

Compilation message (stderr)

bomb.cpp:10:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main () {
       ^
bomb.cpp: In function 'int main()':
bomb.cpp:12:38: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int n, m; scanf ("%d %d", &n, &m);
                                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...