Submission #167410

# Submission time Handle Problem Language Result Execution time Memory
167410 2019-12-08T09:30:30 Z GioChkhaidze Bomb (IZhO17_bomb) C++14
24 / 100
494 ms 16124 KB
#include <bits/stdc++.h>
#define Tree int h,int l,int r
#define Left 2*h,l,(l+r)/2
#define Right 2*h+1,(l+r)/2+1,r
using namespace std;
const int N=2505;
int n,m,width=1e9,length=1e9,last;
string s[N],S;
char c[N][N];
main () {
	scanf("%d%d",&n,&m);
	getline(cin,S);
	for (int i=0; i<n; i++)  
		getline(cin,s[i]);
	
	for (int i=0; i<n; i++) {
		last=m;
		for (int j=m-1; j>=0; j--) {
			if (s[i][j]=='0' && last-1!=j) 
				if (width>last-j-1) width=last-j-1;
			if (s[i][j]=='0') last=j;
		}
		
		if (last) 
			if (last<width) width=last;
	}
	
	for (int j=0; j<m; j++) {
		last=n;
		for (int i=n-1; i>=0; i--) {
			if (s[i][j]=='0' && last-1!=i) 
				if (length>last-i-1) length=last-i-1;
			if (s[i][j]=='0') last=i;
		}
		
		if (last)
			if (last<length) length=last;
	}
	
	if (width==1e9) width=0;
	if (length==1e9) length=0;
	
	cout<<width*length<<endl;
}

Compilation message

bomb.cpp:10:7: 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 time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is 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 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Incorrect 2 ms 376 KB Output isn't correct
16 Correct 2 ms 380 KB Output is correct
17 Correct 3 ms 376 KB Output is correct
18 Incorrect 2 ms 376 KB Output isn't correct
19 Incorrect 3 ms 376 KB Output isn't correct
20 Incorrect 3 ms 376 KB Output isn't correct
21 Incorrect 3 ms 376 KB Output isn't correct
22 Incorrect 3 ms 376 KB Output isn't correct
23 Incorrect 3 ms 504 KB Output isn't correct
24 Incorrect 3 ms 376 KB Output isn't correct
25 Incorrect 3 ms 376 KB Output isn't correct
26 Correct 3 ms 504 KB Output is correct
27 Correct 7 ms 632 KB Output is correct
28 Incorrect 9 ms 636 KB Output isn't correct
29 Incorrect 10 ms 760 KB Output isn't correct
30 Incorrect 14 ms 760 KB Output isn't correct
31 Incorrect 11 ms 760 KB Output isn't correct
32 Incorrect 12 ms 760 KB Output isn't correct
33 Incorrect 35 ms 888 KB Output isn't correct
34 Incorrect 7 ms 632 KB Output isn't correct
35 Incorrect 14 ms 760 KB Output isn't correct
36 Correct 14 ms 892 KB Output is correct
37 Incorrect 2 ms 376 KB Output isn't correct
38 Correct 449 ms 15836 KB Output is correct
39 Incorrect 2 ms 504 KB Output isn't correct
40 Incorrect 49 ms 2040 KB Output isn't correct
41 Incorrect 2 ms 376 KB Output isn't correct
42 Incorrect 2 ms 376 KB Output isn't correct
43 Correct 434 ms 15940 KB Output is correct
44 Incorrect 14 ms 888 KB Output isn't correct
45 Incorrect 397 ms 15992 KB Output isn't correct
46 Correct 399 ms 15924 KB Output is correct
47 Incorrect 401 ms 15992 KB Output isn't correct
48 Incorrect 405 ms 16020 KB Output isn't correct
49 Correct 494 ms 15992 KB Output is correct
50 Incorrect 401 ms 15992 KB Output isn't correct
51 Incorrect 404 ms 15992 KB Output isn't correct
52 Incorrect 404 ms 15960 KB Output isn't correct
53 Incorrect 401 ms 15992 KB Output isn't correct
54 Incorrect 412 ms 16116 KB Output isn't correct
55 Incorrect 456 ms 15920 KB Output isn't correct
56 Correct 406 ms 15992 KB Output is correct
57 Incorrect 402 ms 15992 KB Output isn't correct
58 Incorrect 404 ms 16048 KB Output isn't correct
59 Incorrect 466 ms 16124 KB Output isn't correct
60 Correct 398 ms 16120 KB Output is correct
61 Correct 494 ms 16120 KB Output is correct
62 Correct 399 ms 16120 KB Output is correct
63 Correct 394 ms 15992 KB Output is correct
64 Correct 399 ms 15992 KB Output is correct
65 Incorrect 413 ms 16016 KB Output isn't correct
66 Incorrect 454 ms 15992 KB Output isn't correct
67 Incorrect 404 ms 16108 KB Output isn't correct
68 Incorrect 421 ms 15948 KB Output isn't correct
69 Incorrect 404 ms 15992 KB Output isn't correct
70 Incorrect 260 ms 11896 KB Output isn't correct
71 Incorrect 403 ms 15992 KB Output isn't correct
72 Incorrect 403 ms 16120 KB Output isn't correct
73 Incorrect 400 ms 15992 KB Output isn't correct
74 Incorrect 408 ms 16060 KB Output isn't correct
75 Incorrect 405 ms 16052 KB Output isn't correct
76 Incorrect 404 ms 16036 KB Output isn't correct
77 Incorrect 399 ms 16016 KB Output isn't correct
78 Incorrect 398 ms 15980 KB Output isn't correct
79 Incorrect 398 ms 16024 KB Output isn't correct
80 Incorrect 398 ms 15896 KB Output isn't correct
81 Incorrect 402 ms 16020 KB Output isn't correct
82 Incorrect 406 ms 16048 KB Output isn't correct
83 Incorrect 403 ms 15992 KB Output isn't correct
84 Incorrect 407 ms 16120 KB Output isn't correct
85 Incorrect 415 ms 15944 KB Output isn't correct
86 Incorrect 412 ms 16112 KB Output isn't correct
87 Incorrect 405 ms 15864 KB Output isn't correct
88 Incorrect 422 ms 15996 KB Output isn't correct
89 Incorrect 408 ms 15864 KB Output isn't correct
90 Incorrect 322 ms 11892 KB Output isn't correct
91 Incorrect 406 ms 15992 KB Output isn't correct
92 Incorrect 404 ms 16108 KB Output isn't correct
93 Incorrect 401 ms 15864 KB Output isn't correct
94 Incorrect 405 ms 15952 KB Output isn't correct
95 Incorrect 404 ms 15992 KB Output isn't correct
96 Incorrect 400 ms 15952 KB Output isn't correct
97 Incorrect 410 ms 15992 KB Output isn't correct
98 Incorrect 406 ms 16108 KB Output isn't correct
99 Incorrect 403 ms 15992 KB Output isn't correct
100 Incorrect 466 ms 15972 KB Output isn't correct