Submission #37624

# Submission time Handle Problem Language Result Execution time Memory
37624 2017-12-26T13:22:34 Z Kerim Bomb (IZhO17_bomb) C++14
24 / 100
513 ms 8164 KB
#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x)  cerr<< #x <<" = "<< x<<endl;
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
const int N=2509;
char arr[N][N];
int main(){
    //~ freopen("file.in", "r", stdin);
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			scanf(" %c",&arr[i][j]);
	int xx=INF,yy=INF;		
	for(int i=1;i<=n;i++){
		int cnt=0;
		for(int j=1;j<=m;j++){
			if(arr[i][j]=='0'){
				if(cnt)
					umin(yy,cnt);
				cnt=0;	
			}
			else
				cnt++;
		}
		if(cnt)
			umin(yy,cnt);
	}	
	for(int j=1;j<=m;j++){
		int cnt=0;
		for(int i=1;i<=n;i++){
			if(arr[i][j]=='0'){
				if(cnt)
					umin(xx,cnt);
				cnt=0;	
			}
			else
				cnt++;
		}
		if(cnt)
			umin(xx,cnt);
	}
	if(xx==INF)
		xx=n;
	printf("%d\n",xx*yy);
	return 0;
}

Compilation message

bomb.cpp: In function 'int main()':
bomb.cpp:25:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
                        ^
bomb.cpp:28:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf(" %c",&arr[i][j]);
                           ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8164 KB Output is correct
2 Correct 0 ms 8164 KB Output is correct
3 Correct 0 ms 8164 KB Output is correct
4 Correct 3 ms 8164 KB Output is correct
5 Correct 0 ms 8164 KB Output is correct
6 Correct 0 ms 8164 KB Output is correct
7 Correct 0 ms 8164 KB Output is correct
8 Incorrect 0 ms 8164 KB Output isn't correct
9 Incorrect 0 ms 8164 KB Output isn't correct
10 Incorrect 0 ms 8164 KB Output isn't correct
11 Incorrect 0 ms 8164 KB Output isn't correct
12 Incorrect 0 ms 8164 KB Output isn't correct
13 Correct 0 ms 8164 KB Output is correct
14 Correct 0 ms 8164 KB Output is correct
15 Incorrect 0 ms 8164 KB Output isn't correct
16 Correct 0 ms 8164 KB Output is correct
17 Correct 0 ms 8164 KB Output is correct
18 Incorrect 0 ms 8164 KB Output isn't correct
19 Incorrect 0 ms 8164 KB Output isn't correct
20 Incorrect 0 ms 8164 KB Output isn't correct
21 Incorrect 0 ms 8164 KB Output isn't correct
22 Incorrect 0 ms 8164 KB Output isn't correct
23 Incorrect 0 ms 8164 KB Output isn't correct
24 Incorrect 0 ms 8164 KB Output isn't correct
25 Incorrect 0 ms 8164 KB Output isn't correct
26 Correct 0 ms 8164 KB Output is correct
27 Correct 6 ms 8164 KB Output is correct
28 Incorrect 6 ms 8164 KB Output isn't correct
29 Incorrect 9 ms 8164 KB Output isn't correct
30 Incorrect 6 ms 8164 KB Output isn't correct
31 Incorrect 9 ms 8164 KB Output isn't correct
32 Incorrect 13 ms 8164 KB Output isn't correct
33 Incorrect 13 ms 8164 KB Output isn't correct
34 Incorrect 6 ms 8164 KB Output isn't correct
35 Incorrect 9 ms 8164 KB Output isn't correct
36 Correct 13 ms 8164 KB Output is correct
37 Incorrect 0 ms 8164 KB Output isn't correct
38 Correct 513 ms 8164 KB Output is correct
39 Incorrect 0 ms 8164 KB Output isn't correct
40 Incorrect 49 ms 8164 KB Output isn't correct
41 Incorrect 0 ms 8164 KB Output isn't correct
42 Incorrect 0 ms 8164 KB Output isn't correct
43 Correct 459 ms 8164 KB Output is correct
44 Incorrect 13 ms 8164 KB Output isn't correct
45 Incorrect 463 ms 8164 KB Output isn't correct
46 Correct 419 ms 8164 KB Output is correct
47 Incorrect 479 ms 8164 KB Output isn't correct
48 Incorrect 496 ms 8164 KB Output isn't correct
49 Correct 433 ms 8164 KB Output is correct
50 Incorrect 423 ms 8164 KB Output isn't correct
51 Incorrect 429 ms 8164 KB Output isn't correct
52 Incorrect 416 ms 8164 KB Output isn't correct
53 Incorrect 443 ms 8164 KB Output isn't correct
54 Incorrect 426 ms 8164 KB Output isn't correct
55 Incorrect 456 ms 8164 KB Output isn't correct
56 Correct 413 ms 8164 KB Output is correct
57 Incorrect 476 ms 8164 KB Output isn't correct
58 Incorrect 456 ms 8164 KB Output isn't correct
59 Incorrect 439 ms 8164 KB Output isn't correct
60 Correct 459 ms 8164 KB Output is correct
61 Correct 446 ms 8164 KB Output is correct
62 Correct 416 ms 8164 KB Output is correct
63 Correct 469 ms 8164 KB Output is correct
64 Correct 419 ms 8164 KB Output is correct
65 Incorrect 473 ms 8164 KB Output isn't correct
66 Incorrect 443 ms 8164 KB Output isn't correct
67 Incorrect 423 ms 8164 KB Output isn't correct
68 Incorrect 436 ms 8164 KB Output isn't correct
69 Incorrect 413 ms 8164 KB Output isn't correct
70 Incorrect 266 ms 8164 KB Output isn't correct
71 Incorrect 403 ms 8164 KB Output isn't correct
72 Incorrect 463 ms 8164 KB Output isn't correct
73 Incorrect 463 ms 8164 KB Output isn't correct
74 Incorrect 449 ms 8164 KB Output isn't correct
75 Incorrect 456 ms 8164 KB Output isn't correct
76 Incorrect 466 ms 8164 KB Output isn't correct
77 Incorrect 413 ms 8164 KB Output isn't correct
78 Incorrect 493 ms 8164 KB Output isn't correct
79 Incorrect 449 ms 8164 KB Output isn't correct
80 Incorrect 459 ms 8164 KB Output isn't correct
81 Incorrect 426 ms 8164 KB Output isn't correct
82 Incorrect 449 ms 8164 KB Output isn't correct
83 Incorrect 473 ms 8164 KB Output isn't correct
84 Incorrect 489 ms 8164 KB Output isn't correct
85 Incorrect 486 ms 8164 KB Output isn't correct
86 Incorrect 463 ms 8164 KB Output isn't correct
87 Incorrect 473 ms 8164 KB Output isn't correct
88 Incorrect 463 ms 8164 KB Output isn't correct
89 Incorrect 463 ms 8164 KB Output isn't correct
90 Incorrect 276 ms 8164 KB Output isn't correct
91 Incorrect 456 ms 8164 KB Output isn't correct
92 Incorrect 476 ms 8164 KB Output isn't correct
93 Incorrect 439 ms 8164 KB Output isn't correct
94 Incorrect 496 ms 8164 KB Output isn't correct
95 Incorrect 453 ms 8164 KB Output isn't correct
96 Incorrect 483 ms 8164 KB Output isn't correct
97 Incorrect 409 ms 8164 KB Output isn't correct
98 Incorrect 456 ms 8164 KB Output isn't correct
99 Incorrect 493 ms 8164 KB Output isn't correct
100 Incorrect 479 ms 8164 KB Output isn't correct