Submission #833529

# Submission time Handle Problem Language Result Execution time Memory
833529 2023-08-22T06:33:10 Z vjudge1 Bomb (IZhO17_bomb) C++17
8 / 100
63 ms 19156 KB
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
#define pb push_back
#define pf push_front
#define p push
#define q queue
#define popf pop_front()
#define popb pop_back()
#define dq deque
#define fi first
#define se second
#define ve vector
#define lb lower_bound
#define ub upper_bound
#define pq priority_queue
#define st stack
#define rep(i,a,b) for (ll i=a; i<b; i++)
#define rept(i,a,b) for (ll i=a; i<=b; i++)
#define repr(i,a,b) for (ll i=a; i>=b; i--)
#define ppi pair<ll,ll>
#define test cout<<"A"<<endl

using namespace std;

ll a,b;
ve<string> mp;
ve<string> hor;
ve<string> ver;

int main(){
	ios_base::sync_with_stdio(false);
//    cin.tie(NULL);
    cin>>a>>b;
	rep(i,0,a){
		string s;
	 	cin>>s;
		mp.pb(s);
		hor.pb(s);
		ver.pb(s);
	}
	
	rep(i,0,a){
		rep(j,0,b){
		 	if (mp[i][j] == '1'){
		 		if (i != 0){
		 			ver[i][j]+= ver[i-1][j]-'0';
		 			ver[i-1][j] = '0';
				}
				if (j != 0){
					hor[i][j]+= hor[i][j-1]-'0';
					hor[i][j-1] = '0';
				}
			}
		}
	}
	ll ans = 1e9;
	rep(i,0,a){
		rep(j,0,b){
			ll temp = ver[i][j]-'0';
			if (temp == 0) temp = 99999;
		 	ans = min(ans, temp);
		}
	}
	ll k = 1e9;
	rep(i,0,a){
		rep(j,0,b){
			ll temp = hor[i][j]-'0';
			if (temp == 0) temp = 99999;
		 	k = min(k, temp);
		}
	}
    
    cout<<ans*k<<endl;
    
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 724 KB Output isn't correct
4 Incorrect 1 ms 724 KB Output isn't correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Incorrect 0 ms 212 KB Output isn't correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 0 ms 212 KB Output isn't correct
9 Incorrect 1 ms 212 KB Output isn't correct
10 Incorrect 0 ms 212 KB Output isn't correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Incorrect 1 ms 212 KB Output isn't correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Incorrect 0 ms 212 KB Output isn't correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 340 KB Output is correct
18 Incorrect 0 ms 340 KB Output isn't correct
19 Incorrect 1 ms 340 KB Output isn't correct
20 Incorrect 1 ms 340 KB Output isn't correct
21 Incorrect 1 ms 340 KB Output isn't correct
22 Incorrect 1 ms 340 KB Output isn't correct
23 Incorrect 0 ms 340 KB Output isn't correct
24 Incorrect 1 ms 340 KB Output isn't correct
25 Incorrect 1 ms 340 KB Output isn't correct
26 Incorrect 0 ms 340 KB Output isn't correct
27 Incorrect 1 ms 596 KB Output isn't correct
28 Incorrect 1 ms 596 KB Output isn't correct
29 Incorrect 1 ms 724 KB Output isn't correct
30 Incorrect 1 ms 852 KB Output isn't correct
31 Incorrect 1 ms 724 KB Output isn't correct
32 Incorrect 1 ms 852 KB Output isn't correct
33 Incorrect 2 ms 980 KB Output isn't correct
34 Incorrect 1 ms 596 KB Output isn't correct
35 Incorrect 1 ms 980 KB Output isn't correct
36 Incorrect 2 ms 980 KB Output isn't correct
37 Incorrect 0 ms 212 KB Output isn't correct
38 Incorrect 55 ms 19028 KB Output isn't correct
39 Incorrect 1 ms 212 KB Output isn't correct
40 Incorrect 7 ms 2644 KB Output isn't correct
41 Incorrect 0 ms 212 KB Output isn't correct
42 Incorrect 1 ms 340 KB Output isn't correct
43 Incorrect 46 ms 19028 KB Output isn't correct
44 Incorrect 2 ms 980 KB Output isn't correct
45 Incorrect 45 ms 19028 KB Output isn't correct
46 Correct 41 ms 19028 KB Output is correct
47 Incorrect 44 ms 19080 KB Output isn't correct
48 Incorrect 44 ms 19028 KB Output isn't correct
49 Incorrect 53 ms 19028 KB Output isn't correct
50 Incorrect 50 ms 19156 KB Output isn't correct
51 Incorrect 45 ms 19068 KB Output isn't correct
52 Incorrect 44 ms 19028 KB Output isn't correct
53 Incorrect 43 ms 19028 KB Output isn't correct
54 Incorrect 37 ms 19028 KB Output isn't correct
55 Incorrect 37 ms 19028 KB Output isn't correct
56 Incorrect 54 ms 19028 KB Output isn't correct
57 Incorrect 37 ms 19048 KB Output isn't correct
58 Incorrect 38 ms 19028 KB Output isn't correct
59 Incorrect 37 ms 19028 KB Output isn't correct
60 Incorrect 51 ms 19148 KB Output isn't correct
61 Incorrect 53 ms 19028 KB Output isn't correct
62 Incorrect 54 ms 19072 KB Output isn't correct
63 Incorrect 54 ms 19028 KB Output isn't correct
64 Incorrect 42 ms 19028 KB Output isn't correct
65 Incorrect 45 ms 19028 KB Output isn't correct
66 Incorrect 43 ms 19028 KB Output isn't correct
67 Incorrect 47 ms 19028 KB Output isn't correct
68 Incorrect 47 ms 19068 KB Output isn't correct
69 Incorrect 37 ms 19028 KB Output isn't correct
70 Incorrect 21 ms 12372 KB Output isn't correct
71 Incorrect 35 ms 19028 KB Output isn't correct
72 Incorrect 36 ms 19012 KB Output isn't correct
73 Incorrect 40 ms 19084 KB Output isn't correct
74 Incorrect 37 ms 19084 KB Output isn't correct
75 Incorrect 38 ms 19028 KB Output isn't correct
76 Incorrect 38 ms 19068 KB Output isn't correct
77 Incorrect 38 ms 19028 KB Output isn't correct
78 Incorrect 42 ms 19032 KB Output isn't correct
79 Incorrect 32 ms 18972 KB Output isn't correct
80 Incorrect 40 ms 18972 KB Output isn't correct
81 Incorrect 34 ms 19028 KB Output isn't correct
82 Incorrect 38 ms 19028 KB Output isn't correct
83 Incorrect 38 ms 19028 KB Output isn't correct
84 Incorrect 30 ms 19020 KB Output isn't correct
85 Incorrect 38 ms 19028 KB Output isn't correct
86 Incorrect 63 ms 19072 KB Output isn't correct
87 Incorrect 36 ms 18976 KB Output isn't correct
88 Incorrect 37 ms 19068 KB Output isn't correct
89 Incorrect 42 ms 19028 KB Output isn't correct
90 Incorrect 24 ms 12372 KB Output isn't correct
91 Incorrect 42 ms 19028 KB Output isn't correct
92 Incorrect 43 ms 19028 KB Output isn't correct
93 Incorrect 53 ms 19072 KB Output isn't correct
94 Incorrect 44 ms 19016 KB Output isn't correct
95 Incorrect 41 ms 19028 KB Output isn't correct
96 Incorrect 38 ms 19040 KB Output isn't correct
97 Incorrect 56 ms 18968 KB Output isn't correct
98 Incorrect 40 ms 19064 KB Output isn't correct
99 Incorrect 43 ms 19028 KB Output isn't correct
100 Incorrect 55 ms 19028 KB Output isn't correct