Submission #168965

# Submission time Handle Problem Language Result Execution time Memory
168965 2019-12-17T10:10:58 Z abil Bomb (IZhO17_bomb) C++14
12 / 100
687 ms 12916 KB
#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;
}

Compilation message

bomb.cpp:17:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 7 ms 6520 KB Output isn't correct
4 Incorrect 7 ms 6520 KB Output isn't correct
5 Incorrect 2 ms 376 KB Output isn't correct
6 Incorrect 2 ms 376 KB Output isn't correct
7 Correct 2 ms 376 KB Output is correct
8 Incorrect 2 ms 376 KB Output isn't correct
9 Incorrect 2 ms 376 KB Output isn't correct
10 Incorrect 2 ms 376 KB Output isn't correct
11 Incorrect 2 ms 376 KB Output isn't correct
12 Incorrect 2 ms 376 KB Output isn't correct
13 Incorrect 2 ms 376 KB Output isn't correct
14 Correct 2 ms 380 KB Output is correct
15 Incorrect 2 ms 376 KB Output isn't correct
16 Incorrect 2 ms 376 KB Output isn't correct
17 Correct 3 ms 504 KB Output is correct
18 Incorrect 2 ms 504 KB Output isn't correct
19 Incorrect 3 ms 632 KB Output isn't correct
20 Incorrect 1 ms 504 KB Output isn't correct
21 Incorrect 3 ms 468 KB Output isn't correct
22 Incorrect 3 ms 504 KB Output isn't correct
23 Incorrect 3 ms 504 KB Output isn't correct
24 Incorrect 3 ms 504 KB Output isn't correct
25 Incorrect 4 ms 504 KB Output isn't correct
26 Correct 3 ms 504 KB Output is correct
27 Correct 10 ms 1144 KB Output is correct
28 Incorrect 13 ms 1144 KB Output isn't correct
29 Incorrect 15 ms 1400 KB Output isn't correct
30 Incorrect 22 ms 1604 KB Output isn't correct
31 Incorrect 17 ms 1272 KB Output isn't correct
32 Incorrect 18 ms 1656 KB Output isn't correct
33 Incorrect 23 ms 1660 KB Output isn't correct
34 Incorrect 11 ms 1272 KB Output isn't correct
35 Incorrect 23 ms 1656 KB Output isn't correct
36 Incorrect 23 ms 1656 KB Output isn't correct
37 Incorrect 2 ms 376 KB Output isn't correct
38 Incorrect 627 ms 12636 KB Output isn't correct
39 Incorrect 2 ms 376 KB Output isn't correct
40 Incorrect 80 ms 3192 KB Output isn't correct
41 Incorrect 2 ms 376 KB Output isn't correct
42 Incorrect 3 ms 632 KB Output isn't correct
43 Correct 648 ms 12696 KB Output is correct
44 Incorrect 23 ms 1656 KB Output isn't correct
45 Incorrect 625 ms 12728 KB Output isn't correct
46 Correct 632 ms 12652 KB Output is correct
47 Incorrect 671 ms 12672 KB Output isn't correct
48 Incorrect 641 ms 12664 KB Output isn't correct
49 Correct 629 ms 12664 KB Output is correct
50 Incorrect 627 ms 12664 KB Output isn't correct
51 Incorrect 628 ms 12712 KB Output isn't correct
52 Incorrect 625 ms 12776 KB Output isn't correct
53 Incorrect 682 ms 12664 KB Output isn't correct
54 Incorrect 629 ms 12704 KB Output isn't correct
55 Incorrect 626 ms 12680 KB Output isn't correct
56 Incorrect 647 ms 12792 KB Output isn't correct
57 Incorrect 625 ms 12604 KB Output isn't correct
58 Incorrect 687 ms 12684 KB Output isn't correct
59 Incorrect 641 ms 12720 KB Output isn't correct
60 Correct 677 ms 12792 KB Output is correct
61 Incorrect 670 ms 12776 KB Output isn't correct
62 Correct 629 ms 12556 KB Output is correct
63 Correct 630 ms 12728 KB Output is correct
64 Correct 643 ms 12796 KB Output is correct
65 Incorrect 629 ms 12628 KB Output isn't correct
66 Incorrect 627 ms 12792 KB Output isn't correct
67 Incorrect 629 ms 12788 KB Output isn't correct
68 Incorrect 632 ms 12760 KB Output isn't correct
69 Incorrect 648 ms 12900 KB Output isn't correct
70 Incorrect 439 ms 9336 KB Output isn't correct
71 Incorrect 626 ms 12716 KB Output isn't correct
72 Incorrect 635 ms 12648 KB Output isn't correct
73 Incorrect 623 ms 12580 KB Output isn't correct
74 Incorrect 626 ms 12584 KB Output isn't correct
75 Incorrect 635 ms 12828 KB Output isn't correct
76 Incorrect 627 ms 12792 KB Output isn't correct
77 Incorrect 629 ms 12724 KB Output isn't correct
78 Incorrect 623 ms 12536 KB Output isn't correct
79 Incorrect 638 ms 12816 KB Output isn't correct
80 Incorrect 624 ms 12628 KB Output isn't correct
81 Incorrect 625 ms 12548 KB Output isn't correct
82 Incorrect 627 ms 12584 KB Output isn't correct
83 Incorrect 632 ms 12716 KB Output isn't correct
84 Incorrect 633 ms 12704 KB Output isn't correct
85 Incorrect 655 ms 12636 KB Output isn't correct
86 Incorrect 657 ms 12620 KB Output isn't correct
87 Incorrect 661 ms 12664 KB Output isn't correct
88 Incorrect 630 ms 12752 KB Output isn't correct
89 Incorrect 628 ms 12848 KB Output isn't correct
90 Incorrect 400 ms 9288 KB Output isn't correct
91 Incorrect 625 ms 12628 KB Output isn't correct
92 Incorrect 629 ms 12664 KB Output isn't correct
93 Incorrect 627 ms 12916 KB Output isn't correct
94 Incorrect 627 ms 12664 KB Output isn't correct
95 Incorrect 629 ms 12648 KB Output isn't correct
96 Incorrect 635 ms 12656 KB Output isn't correct
97 Incorrect 626 ms 12752 KB Output isn't correct
98 Incorrect 630 ms 12644 KB Output isn't correct
99 Incorrect 625 ms 12736 KB Output isn't correct
100 Incorrect 631 ms 12792 KB Output isn't correct