제출 #92567

#제출 시각아이디문제언어결과실행 시간메모리
92567Just_Solve_The_ProblemBomb (IZhO17_bomb)C++11
3 / 100
141 ms31224 KiB
#include <bits/stdc++.h>

using namespace std;

const int N = (int)2500 + 7;

int n, m;
int a[N][N];

main() {
	scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; i++) {
		getchar();
		for (int j = 1; j <= m; j++) {
			char c;
			c = getchar();
			a[i][j] = c - '0';
		}
	}
	int mn1, mn2;
	mn1 = m;
	mn2 = n;
	for (int i = 1; i <= n; i++) {
		int cur = 0;
		for (int j = 1; j <= m; j++) {
			if (a[i][j] == 0) {
				if (cur) {
					mn1 = min(mn1, cur);
				}
				cur = 0;
			} else {
				cur++;
			}
		}
	}
	for (int i = 1; i <= m; i++) {
		int cur = 0;
		for (int j = 1; j <= n; j++) {
			if (a[j][i] == 0) {
				if (cur) {
					mn2 = min(mn2, cur);
				}
				cur = 0;
			} else {
				cur++;
			}
		}
	}
	cout << mn1 * mn2;
}

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

bomb.cpp:10:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main() {
      ^
bomb.cpp: In function 'int main()':
bomb.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &m);
  ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...