제출 #168965

#제출 시각아이디문제언어결과실행 시간메모리
168965abilBomb (IZhO17_bomb)C++14
12 / 100
687 ms12916 KiB
#include <bits/stdc++.h>

#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define all(s) s.begin(),s.end()
//#define int long long

using namespace std;

const int N = (2500 + 12);
const int mod = (1e9 + 7);
const int INF = (0x3f3f3f3f);

char a[N][N];
main()
{
	int n, m;
	cin >> n >> m;
	for(int i = 1;i <= n; i++){
		for(int j = 1;j <= m; j++){
			cin >> a[i][j];
		}
	}
	int x = INF, y = INF;
	for(int i = 1;i <= n; i++){
		int cnt = 0;
		for(int j = 1;j <= m; j++){
			if(cnt > 0 && a[i][j] == '0'){
				x = min(x, cnt);
				cnt = 0;
			}
			else
			if(a[i][j] == '1'){
				cnt++;
			}
		}
	}
	for(int i = 1;i <= m; i++){
		int cnt = 0;
		for(int j = 1;j <= n; j++){
			if(cnt > 0 && a[j][i] == '0'){
				y = min(y, cnt);
				cnt = 0;
			}
			else
			if(a[j][i] == '1'){
				cnt++;
			}
		}
	}
	cout << x * y;
}

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

bomb.cpp:17:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...