제출 #833284

#제출 시각아이디문제언어결과실행 시간메모리
833284vjudge1Bomb (IZhO17_bomb)C++17
24 / 100
158 ms11044 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, ver, cnt;
string s[3000];

int main(){
	cin >> n >> m;
	for(int i=0; i<n; i++){
		cin >> s[i];
	}
	
	//cari minimum di horizontal
	vector<int> tmp1;
	for(int i=0; i<n; i++){
		cnt=0;
		for(int j=0; j<=m; j++){
			if(j==m || s[i][j]=='0'){
				if(cnt>0) tmp1.pb(cnt); cnt=0;
			}
			else cnt++;
		}
	}
	sort(tmp1.begin(), tmp1.end());
	if(tmp1.size()>0) hor=tmp1[0];

	
	//cari minimum di vertikal
	vector<int> tmp;
	for(int i=0; i<m; i++){
		cnt=0;
		for(int j=0; j<=n; j++){
			if(j==n || s[j][i]=='0'){
				if(cnt>0) tmp.pb(cnt); cnt=0;
			}
			else cnt++;
		}
	}
	sort(tmp.begin(), tmp.end());
	if(tmp.size()>0) ver=tmp[0];
	cout << hor*ver << endl;
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

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