# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
879876 |
2023-11-28T08:58:18 Z |
KiaRez |
Bomb (IZhO17_bomb) |
C++17 |
|
87 ms |
80216 KB |
/*
IN THE NAME OF GOD
*/
#include <bits/stdc++.h>
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef long double ld;
#define F first
#define S second
#define Mp make_pair
#define pb push_back
#define pf push_front
#define size(x) ((ll)x.size())
#define all(x) (x).begin(),(x).end()
#define kill(x) cout << x << '\n', exit(0);
#define fuck(x) cout << "(" << #x << " , " << x << ")" << endl
#define endl '\n'
const int N = 1e5+23, lg = 18;
ll Mod = 1e9+7; //998244353;
inline ll MOD(ll a, ll mod=Mod) {a%=mod; (a<0)&&(a+=mod); return a;}
inline ll poww(ll a, ll b, ll mod=Mod) {
ll ans = 1;
a=MOD(a, mod);
while (b) {
if (b & 1) ans = MOD(ans*a, mod);
b >>= 1;
a = MOD(a*a, mod);
}
return ans;
}
int n, m, h=1e9, w=1e9, mark[2505][2505], ml[2505][2505], mu[2505][2505];
int main () {
ios_base::sync_with_stdio(false), cin.tie(0);
cin>>n>>m; h=n, w=m;
for(int i=1; i<=n; i++) {
for(int j=1; j<=m; j++) {
char c; cin>>c;
mark[i][j] = (c=='1');
}
}
for(int i=1; i<=n; i++) {
for(int j=1; j<=m; j++) {
if(mark[i][j] == 0) continue;
mu[i][j] = ml[i][j] = 1;
if(mark[i-1][j]) mu[i][j] += mu[i-1][j];
if(mark[i][j-1]) ml[i][j] += mu[i][j-1];
if(mark[i+1][j] == 0) h = min(h, mu[i][j]);
if(mark[i][j+1] == 0) w = min(w, ml[i][j]);
}
}
cout<<h*w<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
4444 KB |
Output isn't correct |
2 |
Correct |
1 ms |
4444 KB |
Output is correct |
3 |
Correct |
7 ms |
72964 KB |
Output is correct |
4 |
Correct |
8 ms |
72964 KB |
Output is correct |
5 |
Incorrect |
1 ms |
4444 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
4444 KB |
Output isn't correct |
7 |
Correct |
1 ms |
4444 KB |
Output is correct |
8 |
Correct |
1 ms |
4444 KB |
Output is correct |
9 |
Incorrect |
1 ms |
4444 KB |
Output isn't correct |
10 |
Correct |
1 ms |
4444 KB |
Output is correct |
11 |
Incorrect |
1 ms |
4444 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
4444 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
4444 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
4444 KB |
Output isn't correct |
15 |
Incorrect |
1 ms |
4444 KB |
Output isn't correct |
16 |
Incorrect |
1 ms |
6492 KB |
Output isn't correct |
17 |
Incorrect |
2 ms |
10588 KB |
Output isn't correct |
18 |
Incorrect |
2 ms |
10588 KB |
Output isn't correct |
19 |
Incorrect |
1 ms |
10588 KB |
Output isn't correct |
20 |
Incorrect |
1 ms |
10588 KB |
Output isn't correct |
21 |
Incorrect |
1 ms |
6608 KB |
Output isn't correct |
22 |
Correct |
1 ms |
10708 KB |
Output is correct |
23 |
Incorrect |
1 ms |
10588 KB |
Output isn't correct |
24 |
Incorrect |
1 ms |
10588 KB |
Output isn't correct |
25 |
Incorrect |
2 ms |
10588 KB |
Output isn't correct |
26 |
Incorrect |
2 ms |
10588 KB |
Output isn't correct |
27 |
Incorrect |
3 ms |
16988 KB |
Output isn't correct |
28 |
Incorrect |
3 ms |
12952 KB |
Output isn't correct |
29 |
Incorrect |
3 ms |
16964 KB |
Output isn't correct |
30 |
Incorrect |
4 ms |
16900 KB |
Output isn't correct |
31 |
Incorrect |
4 ms |
12892 KB |
Output isn't correct |
32 |
Incorrect |
4 ms |
17108 KB |
Output isn't correct |
33 |
Incorrect |
4 ms |
16992 KB |
Output isn't correct |
34 |
Incorrect |
2 ms |
12896 KB |
Output isn't correct |
35 |
Incorrect |
4 ms |
13020 KB |
Output isn't correct |
36 |
Incorrect |
5 ms |
21084 KB |
Output isn't correct |
37 |
Incorrect |
1 ms |
6492 KB |
Output isn't correct |
38 |
Incorrect |
81 ms |
80216 KB |
Output isn't correct |
39 |
Incorrect |
1 ms |
6492 KB |
Output isn't correct |
40 |
Incorrect |
12 ms |
36064 KB |
Output isn't correct |
41 |
Incorrect |
1 ms |
6492 KB |
Output isn't correct |
42 |
Incorrect |
1 ms |
10808 KB |
Output isn't correct |
43 |
Incorrect |
73 ms |
80084 KB |
Output isn't correct |
44 |
Incorrect |
5 ms |
21084 KB |
Output isn't correct |
45 |
Incorrect |
76 ms |
80144 KB |
Output isn't correct |
46 |
Incorrect |
74 ms |
79972 KB |
Output isn't correct |
47 |
Incorrect |
72 ms |
79952 KB |
Output isn't correct |
48 |
Incorrect |
72 ms |
79956 KB |
Output isn't correct |
49 |
Incorrect |
75 ms |
79956 KB |
Output isn't correct |
50 |
Incorrect |
72 ms |
79956 KB |
Output isn't correct |
51 |
Incorrect |
72 ms |
80052 KB |
Output isn't correct |
52 |
Incorrect |
73 ms |
79956 KB |
Output isn't correct |
53 |
Incorrect |
72 ms |
79956 KB |
Output isn't correct |
54 |
Incorrect |
69 ms |
79956 KB |
Output isn't correct |
55 |
Incorrect |
69 ms |
79968 KB |
Output isn't correct |
56 |
Incorrect |
75 ms |
80076 KB |
Output isn't correct |
57 |
Incorrect |
72 ms |
75856 KB |
Output isn't correct |
58 |
Incorrect |
69 ms |
79936 KB |
Output isn't correct |
59 |
Incorrect |
69 ms |
79948 KB |
Output isn't correct |
60 |
Incorrect |
74 ms |
80208 KB |
Output isn't correct |
61 |
Incorrect |
75 ms |
80080 KB |
Output isn't correct |
62 |
Incorrect |
80 ms |
79956 KB |
Output isn't correct |
63 |
Incorrect |
81 ms |
79956 KB |
Output isn't correct |
64 |
Incorrect |
70 ms |
79952 KB |
Output isn't correct |
65 |
Incorrect |
79 ms |
80196 KB |
Output isn't correct |
66 |
Incorrect |
71 ms |
79952 KB |
Output isn't correct |
67 |
Incorrect |
73 ms |
79956 KB |
Output isn't correct |
68 |
Incorrect |
73 ms |
79956 KB |
Output isn't correct |
69 |
Incorrect |
71 ms |
73812 KB |
Output isn't correct |
70 |
Incorrect |
43 ms |
45400 KB |
Output isn't correct |
71 |
Incorrect |
69 ms |
71736 KB |
Output isn't correct |
72 |
Incorrect |
72 ms |
71764 KB |
Output isn't correct |
73 |
Incorrect |
71 ms |
71764 KB |
Output isn't correct |
74 |
Incorrect |
72 ms |
75860 KB |
Output isn't correct |
75 |
Incorrect |
79 ms |
80216 KB |
Output isn't correct |
76 |
Incorrect |
73 ms |
79952 KB |
Output isn't correct |
77 |
Incorrect |
73 ms |
79956 KB |
Output isn't correct |
78 |
Incorrect |
74 ms |
79956 KB |
Output isn't correct |
79 |
Incorrect |
64 ms |
47188 KB |
Output isn't correct |
80 |
Incorrect |
67 ms |
51408 KB |
Output isn't correct |
81 |
Incorrect |
66 ms |
51284 KB |
Output isn't correct |
82 |
Incorrect |
76 ms |
79968 KB |
Output isn't correct |
83 |
Incorrect |
76 ms |
79948 KB |
Output isn't correct |
84 |
Incorrect |
67 ms |
38972 KB |
Output isn't correct |
85 |
Incorrect |
73 ms |
79956 KB |
Output isn't correct |
86 |
Incorrect |
79 ms |
79960 KB |
Output isn't correct |
87 |
Incorrect |
87 ms |
79956 KB |
Output isn't correct |
88 |
Incorrect |
71 ms |
79956 KB |
Output isn't correct |
89 |
Incorrect |
80 ms |
80080 KB |
Output isn't correct |
90 |
Incorrect |
48 ms |
69972 KB |
Output isn't correct |
91 |
Incorrect |
73 ms |
79956 KB |
Output isn't correct |
92 |
Incorrect |
75 ms |
79956 KB |
Output isn't correct |
93 |
Incorrect |
78 ms |
80212 KB |
Output isn't correct |
94 |
Incorrect |
79 ms |
79956 KB |
Output isn't correct |
95 |
Incorrect |
71 ms |
80080 KB |
Output isn't correct |
96 |
Incorrect |
70 ms |
80072 KB |
Output isn't correct |
97 |
Incorrect |
77 ms |
79936 KB |
Output isn't correct |
98 |
Incorrect |
70 ms |
79956 KB |
Output isn't correct |
99 |
Incorrect |
74 ms |
79956 KB |
Output isn't correct |
100 |
Incorrect |
75 ms |
79956 KB |
Output isn't correct |