# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
167192 |
2019-12-06T10:04:51 Z |
hentai_lover |
Bomb (IZhO17_bomb) |
C++14 |
|
46 ms |
3324 KB |
#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
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 time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Incorrect |
22 ms |
3324 KB |
Output isn't correct |
4 |
Incorrect |
23 ms |
3320 KB |
Output isn't correct |
5 |
Incorrect |
6 ms |
376 KB |
Output isn't correct |
6 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
380 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
11 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
12 |
Incorrect |
2 ms |
380 KB |
Output isn't correct |
13 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
14 |
Correct |
2 ms |
376 KB |
Output is correct |
15 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
16 |
Incorrect |
4 ms |
376 KB |
Output isn't correct |
17 |
Incorrect |
10 ms |
504 KB |
Output isn't correct |
18 |
Incorrect |
9 ms |
504 KB |
Output isn't correct |
19 |
Incorrect |
22 ms |
504 KB |
Output isn't correct |
20 |
Incorrect |
23 ms |
504 KB |
Output isn't correct |
21 |
Incorrect |
10 ms |
376 KB |
Output isn't correct |
22 |
Incorrect |
20 ms |
488 KB |
Output isn't correct |
23 |
Incorrect |
36 ms |
504 KB |
Output isn't correct |
24 |
Incorrect |
15 ms |
532 KB |
Output isn't correct |
25 |
Incorrect |
36 ms |
504 KB |
Output isn't correct |
26 |
Incorrect |
46 ms |
504 KB |
Output isn't correct |
27 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
28 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
29 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
30 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
31 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
32 |
Incorrect |
2 ms |
380 KB |
Output isn't correct |
33 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
34 |
Incorrect |
2 ms |
436 KB |
Output isn't correct |
35 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
36 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
37 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
38 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
39 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
40 |
Incorrect |
1 ms |
376 KB |
Output isn't correct |
41 |
Incorrect |
2 ms |
444 KB |
Output isn't correct |
42 |
Incorrect |
37 ms |
504 KB |
Output isn't correct |
43 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
44 |
Incorrect |
18 ms |
376 KB |
Output isn't correct |
45 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
46 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
47 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
48 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
49 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
50 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
51 |
Incorrect |
2 ms |
380 KB |
Output isn't correct |
52 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
53 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
54 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
55 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
56 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
57 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
58 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
59 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
60 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
61 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
62 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
63 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
64 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
65 |
Incorrect |
1 ms |
376 KB |
Output isn't correct |
66 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
67 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
68 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
69 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
70 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
71 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
72 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
73 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
74 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
75 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
76 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
77 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
78 |
Incorrect |
2 ms |
380 KB |
Output isn't correct |
79 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
80 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
81 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
82 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
83 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
84 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
85 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
86 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
87 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
88 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
89 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
90 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
91 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
92 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
93 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
94 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
95 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
96 |
Incorrect |
15 ms |
504 KB |
Output isn't correct |
97 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
98 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
99 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
100 |
Incorrect |
0 ms |
376 KB |
Output isn't correct |