Submission #879879

# Submission time Handle Problem Language Result Execution time Memory
879879 2023-11-28T09:01:51 Z KiaRez Bomb (IZhO17_bomb) C++17
5 / 100
80 ms 74324 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-1)*w<<endl;

	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 4440 KB Output isn't correct
2 Incorrect 1 ms 4440 KB Output isn't correct
3 Incorrect 8 ms 72796 KB Output isn't correct
4 Incorrect 8 ms 72940 KB Output isn't correct
5 Incorrect 1 ms 4444 KB Output isn't correct
6 Incorrect 1 ms 4444 KB Output isn't correct
7 Incorrect 1 ms 4444 KB Output isn't correct
8 Incorrect 1 ms 4444 KB Output isn't correct
9 Incorrect 1 ms 4444 KB Output isn't correct
10 Incorrect 1 ms 4444 KB Output isn't correct
11 Correct 1 ms 4440 KB Output is correct
12 Correct 1 ms 4444 KB Output is correct
13 Incorrect 1 ms 4444 KB Output isn't correct
14 Incorrect 1 ms 4564 KB Output isn't correct
15 Correct 1 ms 4444 KB Output is correct
16 Incorrect 1 ms 6492 KB Output isn't correct
17 Incorrect 1 ms 10588 KB Output isn't correct
18 Correct 1 ms 10588 KB Output is correct
19 Incorrect 2 ms 10588 KB Output isn't correct
20 Incorrect 1 ms 10588 KB Output isn't correct
21 Correct 1 ms 6492 KB Output is correct
22 Incorrect 1 ms 10588 KB Output isn't correct
23 Incorrect 1 ms 10588 KB Output isn't correct
24 Incorrect 1 ms 10588 KB Output isn't correct
25 Incorrect 1 ms 10588 KB Output isn't correct
26 Incorrect 1 ms 10588 KB Output isn't correct
27 Incorrect 3 ms 16732 KB Output isn't correct
28 Incorrect 3 ms 12636 KB Output isn't correct
29 Incorrect 3 ms 16852 KB Output isn't correct
30 Incorrect 4 ms 16732 KB Output isn't correct
31 Incorrect 3 ms 12632 KB Output isn't correct
32 Incorrect 4 ms 16732 KB Output isn't correct
33 Incorrect 4 ms 16732 KB Output isn't correct
34 Incorrect 2 ms 12636 KB Output isn't correct
35 Incorrect 3 ms 12760 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 73 ms 74068 KB Output isn't correct
39 Incorrect 1 ms 6488 KB Output isn't correct
40 Incorrect 12 ms 35420 KB Output isn't correct
41 Incorrect 1 ms 6492 KB Output isn't correct
42 Incorrect 2 ms 10588 KB Output isn't correct
43 Incorrect 72 ms 73944 KB Output isn't correct
44 Incorrect 5 ms 20828 KB Output isn't correct
45 Incorrect 71 ms 73952 KB Output isn't correct
46 Incorrect 69 ms 74068 KB Output isn't correct
47 Incorrect 69 ms 73812 KB Output isn't correct
48 Incorrect 76 ms 73948 KB Output isn't correct
49 Incorrect 72 ms 74068 KB Output isn't correct
50 Incorrect 71 ms 74064 KB Output isn't correct
51 Incorrect 72 ms 74064 KB Output isn't correct
52 Incorrect 69 ms 73956 KB Output isn't correct
53 Incorrect 69 ms 73952 KB Output isn't correct
54 Incorrect 67 ms 74028 KB Output isn't correct
55 Incorrect 74 ms 73960 KB Output isn't correct
56 Incorrect 74 ms 73900 KB Output isn't correct
57 Incorrect 68 ms 69828 KB Output isn't correct
58 Incorrect 74 ms 73960 KB Output isn't correct
59 Incorrect 75 ms 74204 KB Output isn't correct
60 Incorrect 68 ms 74068 KB Output isn't correct
61 Incorrect 73 ms 74068 KB Output isn't correct
62 Incorrect 71 ms 74052 KB Output isn't correct
63 Incorrect 80 ms 73952 KB Output isn't correct
64 Incorrect 71 ms 74004 KB Output isn't correct
65 Incorrect 74 ms 74068 KB Output isn't correct
66 Incorrect 75 ms 74064 KB Output isn't correct
67 Incorrect 72 ms 74188 KB Output isn't correct
68 Incorrect 70 ms 73944 KB Output isn't correct
69 Incorrect 67 ms 67824 KB Output isn't correct
70 Incorrect 42 ms 41424 KB Output isn't correct
71 Incorrect 65 ms 65616 KB Output isn't correct
72 Incorrect 72 ms 65672 KB Output isn't correct
73 Incorrect 67 ms 65772 KB Output isn't correct
74 Incorrect 73 ms 70144 KB Output isn't correct
75 Incorrect 67 ms 73948 KB Output isn't correct
76 Incorrect 68 ms 73944 KB Output isn't correct
77 Incorrect 67 ms 73948 KB Output isn't correct
78 Incorrect 68 ms 74012 KB Output isn't correct
79 Incorrect 63 ms 41044 KB Output isn't correct
80 Incorrect 62 ms 45020 KB Output isn't correct
81 Incorrect 63 ms 45216 KB Output isn't correct
82 Incorrect 68 ms 73808 KB Output isn't correct
83 Incorrect 69 ms 73952 KB Output isn't correct
84 Incorrect 62 ms 32848 KB Output isn't correct
85 Incorrect 71 ms 73952 KB Output isn't correct
86 Incorrect 73 ms 73940 KB Output isn't correct
87 Incorrect 67 ms 73940 KB Output isn't correct
88 Incorrect 68 ms 73808 KB Output isn't correct
89 Incorrect 69 ms 73808 KB Output isn't correct
90 Incorrect 46 ms 66132 KB Output isn't correct
91 Incorrect 69 ms 73952 KB Output isn't correct
92 Incorrect 70 ms 73992 KB Output isn't correct
93 Incorrect 71 ms 73808 KB Output isn't correct
94 Incorrect 70 ms 73952 KB Output isn't correct
95 Incorrect 74 ms 73956 KB Output isn't correct
96 Incorrect 68 ms 73968 KB Output isn't correct
97 Incorrect 74 ms 73812 KB Output isn't correct
98 Incorrect 68 ms 73936 KB Output isn't correct
99 Incorrect 70 ms 73944 KB Output isn't correct
100 Incorrect 73 ms 74324 KB Output isn't correct