제출 #38374

#제출 시각아이디문제언어결과실행 시간메모리
38374antimirageBomb (IZhO17_bomb)C++14
26 / 100
1000 ms2504 KiB
#include <iostream> #include <vector> #include <deque> #include <math.h> #include <set> #include <iomanip> #include <time.h> #include <list> #include <stdio.h> #include <queue> #include <map> #include <algorithm> #include <assert.h> #include <memory.h> #define mk make_pair #define sc second #define fr first #define pb emplace_back #define all(s) s.begin(), s.end() #define sz(s) ( (int)s.size() ) using namespace std; const int N = 250; int n, m, ans; int u[N][N], ar[N][N]; bool FL = true; inline bool check(int w, int h) { for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) u[i][j] = ar[i][j]; for (int i = w; i <= n; i++) { for (int j = h; j <= m; j++) { if (ar[i][j] == 1) { bool fl = false; for (int k = i - w + 1; k <= i; k++) { for (int l = j - h + 1; l <= j; l++) { if (u[k][l] == 0) { fl = true; break; } } if (fl) break; } if (!fl) { for (int k = i - w + 1; k <= i; k++) for (int l = j - h + 1; l <= j; l++) u[k][l] = -1; } } } } for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) { if (u[i][j] == 1) return false; } return true; } main () { cin >> n >> m; for (int i = 1; i <= n; i++) { scanf("\n"); for (int j = 1; j <= m; j++) { char ch; scanf("%c", &ch); ar[i][j] = ch - 48; if (ar[i][j] == 1) FL = false; } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (check(i, j)) ans = max(ans, i * j); } } if (FL) ans = 0; cout << ans << endl; }

컴파일 시 표준 에러 (stderr) 메시지

bomb.cpp:77:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main ()
       ^
bomb.cpp: In function 'int main()':
bomb.cpp:83:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("\n");
                    ^
bomb.cpp:87:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%c", &ch);
                             ^
#Verdict Execution timeMemoryGrader output
Fetching results...