Submission #167192

#TimeUsernameProblemLanguageResultExecution timeMemory
167192hentai_loverBomb (IZhO17_bomb)C++14
1 / 100
46 ms3324 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #pragma GCC optimize("-O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #define pb push_back #define fr(i, l, r) for(ll i = l; i <= r; ++ i) #define rf(i, l, r) for(ll i = l; i >= r; -- i) using namespace std; using namespace __gnu_pbds; template <typename T> using _set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; typedef int ll; typedef pair<ll, ll> pll; const ll oo = ll(1e9) + 10; ll p[3000][300]; ll get(ll x1, ll y1, ll x2, ll y2){ return p[x2][y2] - p[x2][y1 - 1] - p[x1 - 1][y2] + p[x1 - 1][y1 - 1]; } int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); ll n, m, ansx = 0, ansy = 0, ans = 0; cin >> n >> m; if(n * m > 10000)return 0; char a[n + 1][m + 1]; fr(i, 1, n)fr(j, 1, m){ cin >> a[i][j]; p[i][j] = p[i - 1][j] + p[i][j - 1] + a[i][j] - '0'; } fr(r, 1, n){ fr(c, 1, m){ fr(i, 1, n - r + 1){ fr(j, 1, m - c + 1){ if(get(i, j, i + r - 1, j + c - 1) == 0){ if(ans < r * c)ans = r * c, ansx = r, ansy = c; } } } } } //cout << ansx << ' ' << ansy << endl; cout << ans; } /* 3 3 1 5 1 2 3 1 3 5 2 3 */

Compilation message (stderr)

bomb.cpp: In function 'int main()':
bomb.cpp:31:14: warning: variable 'ansx' set but not used [-Wunused-but-set-variable]
     ll n, m, ansx = 0, ansy = 0, ans = 0;
              ^~~~
bomb.cpp:31:24: warning: variable 'ansy' set but not used [-Wunused-but-set-variable]
     ll n, m, ansx = 0, ansy = 0, ans = 0;
                        ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...