답안 #91372

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
91372 2018-12-27T09:18:47 Z emil_physmath Bomb (IZhO17_bomb) C++11
9 / 100
7 ms 6560 KB
#include <iostream>
#include <stdio.h>
using namespace std;

bool a[2505][2505];

int FindWid(int n, int m);
int FindLen(int n, int m);
int main()
{
	int n, m;
	cin>>n>>m;
  	int zer=0;
  	if (n>19 && m>19)
      cout<<8/zer<<'\n';
	for (int i=0; i<n; i++)
		for (int j=0; j<m; j++)
		{
			char temp;
			scanf(" %c", &temp);
			a[i][j]=(temp=='1'?true:false);
		}
	cout<<FindWid(n, m)*FindLen(n, m)<<'\n';

	char I;
	cin >> I;
	return 0;
}
int FindWid(int n, int m)
{
	int minWid=-1;
	for (int j=0; j<m; j++)
		for (int sti=0; sti<n; sti++)
		{
			int i=sti;
			if (!a[i][j]) continue;
			while (i+1<n && a[i+1][j])
				i++;
			if (minWid==-1 || i-sti+1<minWid)
				minWid=i-sti+1;
			sti=i;
		}
	return minWid==-1?0:minWid;
}
int FindLen(int n, int m)
{
	int minLen=-1;
	for (int i=0; i<n; i++)
		for (int stj=0; stj<m; stj++)
		{
			int j=stj;
			if (!a[i][j]) continue;
			while (j+1<m && a[i][j+1])
				j++;
			if (minLen==-1 || j-stj+1<minLen)
				minLen=j-stj+1;
			stj=j;
		}
	return minLen==-1?0:minLen;
}

Compilation message

bomb.cpp: In function 'int main()':
bomb.cpp:20:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf(" %c", &temp);
    ~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 480 KB Output is correct
3 Correct 6 ms 6468 KB Output is correct
4 Correct 7 ms 6560 KB Output is correct
5 Correct 2 ms 6560 KB Output is correct
6 Correct 2 ms 6560 KB Output is correct
7 Correct 2 ms 6560 KB Output is correct
8 Runtime error 3 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
9 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
10 Incorrect 2 ms 6560 KB Output isn't correct
11 Incorrect 2 ms 6560 KB Output isn't correct
12 Incorrect 2 ms 6560 KB Output isn't correct
13 Correct 2 ms 6560 KB Output is correct
14 Correct 2 ms 6560 KB Output is correct
15 Incorrect 2 ms 6560 KB Output isn't correct
16 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
17 Runtime error 3 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
18 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
19 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
20 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
21 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
22 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
23 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
24 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
25 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
26 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
27 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
28 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
29 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
30 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
31 Runtime error 3 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
32 Runtime error 3 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
33 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
34 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
35 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
36 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
37 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
38 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
39 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
40 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
41 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
42 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
43 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
44 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
45 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
46 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
47 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
48 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
49 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
50 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
51 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
52 Runtime error 3 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
53 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
54 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
55 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
56 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
57 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
58 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
59 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
60 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
61 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
62 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
63 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
64 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
65 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
66 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
67 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
68 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
69 Runtime error 3 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
70 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
71 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
72 Runtime error 3 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
73 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
74 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
75 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
76 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
77 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
78 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
79 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
80 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
81 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
82 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
83 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
84 Runtime error 3 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
85 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
86 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
87 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
88 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
89 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
90 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
91 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
92 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
93 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
94 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
95 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
96 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
97 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
98 Runtime error 3 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
99 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)
100 Runtime error 2 ms 6560 KB Execution killed with signal 4 (could be triggered by violating memory limits)