답안 #497102

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
497102 2021-12-22T11:57:37 Z ACE_ Bomb (IZhO17_bomb) C++17
24 / 100
433 ms 12716 KB
#include<bits/stdc++.h>
#define f first
#define s second
#define pii pair<int,int>
using namespace std;
int t, n, m, w, h;
char a[2505][2505];
main(){
	cin >> n >> m;
	w = m; h = n;
	for(int i = 1; i <= n; i++) {
		int x = 0;
		for(int j = 1; j <= m; j++) {
			cin >> a[i][j];
			if(a[i][j] == '0') {
				if(x) w = min(w,x);
				x = 0;
			}
			else x++;
		}
		if(x) w = min(w, x);
	}
	for(int j = 1; j <= m; j++) {
		int x = 0;
		for(int i = 1; i <= n; i++) {
			if(a[i][j] == '0') {
				if(x) h = min(h, x);
				x = 0;
			} else x++;
		}
		if(x) h = min(h, x);
	}
	cout << h * w;
}

Compilation message

bomb.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main(){
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 284 KB Output is correct
2 Correct 0 ms 336 KB Output is correct
3 Correct 3 ms 6352 KB Output is correct
4 Correct 3 ms 6412 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 ms 208 KB Output is correct
8 Incorrect 1 ms 336 KB Output isn't correct
9 Incorrect 1 ms 336 KB Output isn't correct
10 Incorrect 0 ms 336 KB Output isn't correct
11 Incorrect 0 ms 336 KB Output isn't correct
12 Incorrect 0 ms 336 KB Output isn't correct
13 Correct 0 ms 308 KB Output is correct
14 Correct 0 ms 336 KB Output is correct
15 Incorrect 1 ms 336 KB Output isn't correct
16 Correct 1 ms 296 KB Output is correct
17 Correct 1 ms 464 KB Output is correct
18 Incorrect 1 ms 432 KB Output isn't correct
19 Incorrect 1 ms 464 KB Output isn't correct
20 Incorrect 1 ms 464 KB Output isn't correct
21 Incorrect 1 ms 432 KB Output isn't correct
22 Incorrect 1 ms 464 KB Output isn't correct
23 Incorrect 1 ms 464 KB Output isn't correct
24 Incorrect 1 ms 464 KB Output isn't correct
25 Incorrect 1 ms 464 KB Output isn't correct
26 Correct 1 ms 464 KB Output is correct
27 Correct 5 ms 1084 KB Output is correct
28 Incorrect 7 ms 1052 KB Output isn't correct
29 Incorrect 9 ms 1260 KB Output isn't correct
30 Incorrect 14 ms 1532 KB Output isn't correct
31 Incorrect 9 ms 1176 KB Output isn't correct
32 Incorrect 11 ms 1452 KB Output isn't correct
33 Incorrect 12 ms 1496 KB Output isn't correct
34 Incorrect 8 ms 1212 KB Output isn't correct
35 Incorrect 12 ms 1488 KB Output isn't correct
36 Correct 12 ms 1500 KB Output is correct
37 Incorrect 1 ms 336 KB Output isn't correct
38 Correct 369 ms 12544 KB Output is correct
39 Incorrect 1 ms 304 KB Output isn't correct
40 Incorrect 50 ms 3104 KB Output isn't correct
41 Incorrect 1 ms 336 KB Output isn't correct
42 Incorrect 1 ms 436 KB Output isn't correct
43 Correct 370 ms 12524 KB Output is correct
44 Incorrect 12 ms 1588 KB Output isn't correct
45 Incorrect 365 ms 12620 KB Output isn't correct
46 Correct 372 ms 12576 KB Output is correct
47 Incorrect 367 ms 12460 KB Output isn't correct
48 Incorrect 356 ms 12456 KB Output isn't correct
49 Correct 362 ms 12488 KB Output is correct
50 Incorrect 389 ms 12536 KB Output isn't correct
51 Incorrect 370 ms 12432 KB Output isn't correct
52 Incorrect 378 ms 12432 KB Output isn't correct
53 Incorrect 433 ms 12508 KB Output isn't correct
54 Incorrect 372 ms 12460 KB Output isn't correct
55 Incorrect 377 ms 12464 KB Output isn't correct
56 Correct 372 ms 12484 KB Output is correct
57 Incorrect 371 ms 12560 KB Output isn't correct
58 Incorrect 370 ms 12416 KB Output isn't correct
59 Incorrect 361 ms 12460 KB Output isn't correct
60 Correct 382 ms 12468 KB Output is correct
61 Correct 368 ms 12512 KB Output is correct
62 Correct 361 ms 12656 KB Output is correct
63 Correct 357 ms 12496 KB Output is correct
64 Correct 361 ms 12504 KB Output is correct
65 Incorrect 356 ms 12628 KB Output isn't correct
66 Incorrect 350 ms 12444 KB Output isn't correct
67 Incorrect 364 ms 12508 KB Output isn't correct
68 Incorrect 348 ms 12436 KB Output isn't correct
69 Incorrect 364 ms 12612 KB Output isn't correct
70 Incorrect 223 ms 9012 KB Output isn't correct
71 Incorrect 362 ms 12504 KB Output isn't correct
72 Incorrect 356 ms 12528 KB Output isn't correct
73 Incorrect 360 ms 12532 KB Output isn't correct
74 Incorrect 369 ms 12424 KB Output isn't correct
75 Incorrect 353 ms 12564 KB Output isn't correct
76 Incorrect 348 ms 12716 KB Output isn't correct
77 Incorrect 354 ms 12536 KB Output isn't correct
78 Incorrect 359 ms 12456 KB Output isn't correct
79 Incorrect 354 ms 12708 KB Output isn't correct
80 Incorrect 351 ms 12456 KB Output isn't correct
81 Incorrect 376 ms 12568 KB Output isn't correct
82 Incorrect 353 ms 12432 KB Output isn't correct
83 Incorrect 353 ms 12524 KB Output isn't correct
84 Incorrect 360 ms 12460 KB Output isn't correct
85 Incorrect 352 ms 12488 KB Output isn't correct
86 Incorrect 363 ms 12408 KB Output isn't correct
87 Incorrect 355 ms 12496 KB Output isn't correct
88 Incorrect 347 ms 12664 KB Output isn't correct
89 Incorrect 387 ms 12432 KB Output isn't correct
90 Incorrect 226 ms 9028 KB Output isn't correct
91 Incorrect 357 ms 12420 KB Output isn't correct
92 Incorrect 354 ms 12408 KB Output isn't correct
93 Incorrect 358 ms 12564 KB Output isn't correct
94 Incorrect 358 ms 12596 KB Output isn't correct
95 Incorrect 357 ms 12572 KB Output isn't correct
96 Incorrect 363 ms 12488 KB Output isn't correct
97 Incorrect 356 ms 12556 KB Output isn't correct
98 Incorrect 359 ms 12520 KB Output isn't correct
99 Incorrect 398 ms 12456 KB Output isn't correct
100 Incorrect 384 ms 12488 KB Output isn't correct