Submission #833373

#TimeUsernameProblemLanguageResultExecution timeMemory
833373vjudge1Bomb (IZhO17_bomb)C++17
24 / 100
137 ms9920 KiB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define pll pair<ll, ll>
using namespace std;
ll n, m, hor=1e9, ver=1e9, cnt;
string s[3000];

int main(){
	cin >> n >> m;
	for(ll i=0; i<n; i++){
		cin >> s[i];
	}
	
	//cari minimum di horizontal
	for(ll i=0; i<n; i++){
		cnt=0;
		for(ll j=0; j<=m; j++){
			if(j==m || s[i][j]=='0'){
				if(cnt>0) hor=min(hor, cnt); cnt=0;
			}
			else cnt++;
		}
	}
	
	//cari minimum di vertikal
	for(ll i=0; i<m; i++){
		cnt=0;
		for(ll j=0; j<=n; j++){
			if(j==n || s[j][i]=='0'){
				if(cnt>0) ver=min(ver, cnt); cnt=0;
			}
			else cnt++;
		}
	}
	cout << hor*ver << endl;
	return 0;
}

Compilation message (stderr)

bomb.cpp: In function 'int main()':
bomb.cpp:22:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   22 |     if(cnt>0) hor=min(hor, cnt); cnt=0;
      |     ^~
bomb.cpp:22:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   22 |     if(cnt>0) hor=min(hor, cnt); cnt=0;
      |                                  ^~~
bomb.cpp:33:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   33 |     if(cnt>0) ver=min(ver, cnt); cnt=0;
      |     ^~
bomb.cpp:33:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   33 |     if(cnt>0) ver=min(ver, cnt); cnt=0;
      |                                  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...