Submission #833221

# Submission time Handle Problem Language Result Execution time Memory
833221 2023-08-22T03:21:39 Z vjudge1 Bomb (IZhO17_bomb) C++17
14 / 100
130 ms 19788 KB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define pll pair<ll, ll>
using namespace std;
int m, n, ans, ver, hor, k;
string s[2500];
vector<int> v;

void check_hor(){
	for(int j=1; j<=n; j++){
		k=0;
		for(int i=0; i<=m; i++){
			if(i<m && s[j][i]=='1') k++;
			else{
				if(k>0) v.pb(k); k=0;
			}
		}
	}
	sort(v.begin(), v.end());
	if(v.size()>0) hor=v[0];
}

void check_ver(){
	for(int j=0; j<m; j++){
		k=0;
		for(int i=1; i<=n+1; i++){
			if(i<=n && s[i][j]=='1') k++;
			else{
				if(k>0) v.pb(k); k=0;
			}
		}	
	}
	sort(v.begin(), v.end());
	if(v.size()>0) ver=v[0];
}

int main(){
	cin >> n >> m;
	for(int i=1; i<=n; i++){
		cin >> s[i];
	}
	check_hor(); 
	v.clear();
	check_ver();
	
	cout << ver*hor << endl;
	return 0;
}

Compilation message

bomb.cpp: In function 'void check_hor()':
bomb.cpp:18:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   18 |     if(k>0) v.pb(k); k=0;
      |     ^~
bomb.cpp:18:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   18 |     if(k>0) v.pb(k); k=0;
      |                      ^
bomb.cpp: In function 'void check_ver()':
bomb.cpp:32:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   32 |     if(k>0) v.pb(k); k=0;
      |     ^~
bomb.cpp:32:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   32 |     if(k>0) v.pb(k); k=0;
      |                      ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Incorrect 0 ms 340 KB Output isn't correct
9 Incorrect 0 ms 340 KB Output isn't correct
10 Incorrect 0 ms 340 KB Output isn't correct
11 Incorrect 0 ms 340 KB Output isn't correct
12 Incorrect 1 ms 340 KB Output isn't correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Incorrect 0 ms 340 KB Output isn't correct
16 Correct 0 ms 340 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Incorrect 0 ms 340 KB Output isn't correct
19 Incorrect 1 ms 340 KB Output isn't correct
20 Incorrect 0 ms 340 KB Output isn't correct
21 Incorrect 0 ms 340 KB Output isn't correct
22 Incorrect 0 ms 340 KB Output isn't correct
23 Incorrect 1 ms 464 KB Output isn't correct
24 Incorrect 0 ms 340 KB Output isn't correct
25 Incorrect 1 ms 340 KB Output isn't correct
26 Correct 0 ms 340 KB Output is correct
27 Correct 2 ms 468 KB Output is correct
28 Incorrect 2 ms 592 KB Output isn't correct
29 Incorrect 3 ms 468 KB Output isn't correct
30 Incorrect 3 ms 592 KB Output isn't correct
31 Incorrect 3 ms 468 KB Output isn't correct
32 Incorrect 3 ms 468 KB Output isn't correct
33 Incorrect 4 ms 596 KB Output isn't correct
34 Incorrect 2 ms 340 KB Output isn't correct
35 Incorrect 4 ms 596 KB Output isn't correct
36 Correct 4 ms 596 KB Output is correct
37 Incorrect 0 ms 340 KB Output isn't correct
38 Runtime error 100 ms 19668 KB Execution killed with signal 11
39 Incorrect 0 ms 340 KB Output isn't correct
40 Incorrect 15 ms 1228 KB Output isn't correct
41 Incorrect 0 ms 340 KB Output isn't correct
42 Incorrect 1 ms 340 KB Output isn't correct
43 Runtime error 98 ms 19648 KB Execution killed with signal 11
44 Incorrect 4 ms 596 KB Output isn't correct
45 Runtime error 95 ms 19572 KB Execution killed with signal 11
46 Runtime error 94 ms 19588 KB Execution killed with signal 11
47 Runtime error 95 ms 19632 KB Execution killed with signal 11
48 Runtime error 95 ms 19624 KB Execution killed with signal 11
49 Runtime error 94 ms 19584 KB Execution killed with signal 11
50 Runtime error 99 ms 19672 KB Execution killed with signal 11
51 Runtime error 94 ms 19628 KB Execution killed with signal 11
52 Runtime error 94 ms 19660 KB Execution killed with signal 11
53 Runtime error 95 ms 19660 KB Execution killed with signal 11
54 Runtime error 93 ms 19608 KB Execution killed with signal 11
55 Runtime error 95 ms 19584 KB Execution killed with signal 11
56 Runtime error 98 ms 19660 KB Execution killed with signal 11
57 Runtime error 96 ms 19564 KB Execution killed with signal 11
58 Runtime error 95 ms 19616 KB Execution killed with signal 11
59 Runtime error 100 ms 19788 KB Execution killed with signal 11
60 Runtime error 95 ms 19780 KB Execution killed with signal 11
61 Runtime error 93 ms 19636 KB Execution killed with signal 11
62 Runtime error 98 ms 19664 KB Execution killed with signal 11
63 Runtime error 95 ms 19660 KB Execution killed with signal 11
64 Runtime error 95 ms 19640 KB Execution killed with signal 11
65 Runtime error 95 ms 19660 KB Execution killed with signal 11
66 Runtime error 95 ms 19632 KB Execution killed with signal 11
67 Runtime error 99 ms 19660 KB Execution killed with signal 11
68 Runtime error 95 ms 19668 KB Execution killed with signal 11
69 Runtime error 94 ms 19676 KB Execution killed with signal 11
70 Incorrect 67 ms 7916 KB Output isn't correct
71 Runtime error 93 ms 19564 KB Execution killed with signal 11
72 Runtime error 94 ms 19572 KB Execution killed with signal 11
73 Runtime error 99 ms 19660 KB Execution killed with signal 11
74 Runtime error 97 ms 19664 KB Execution killed with signal 11
75 Runtime error 93 ms 19604 KB Execution killed with signal 11
76 Runtime error 95 ms 19660 KB Execution killed with signal 11
77 Runtime error 111 ms 19660 KB Execution killed with signal 11
78 Runtime error 94 ms 19688 KB Execution killed with signal 11
79 Runtime error 93 ms 19644 KB Execution killed with signal 11
80 Runtime error 94 ms 19648 KB Execution killed with signal 11
81 Runtime error 93 ms 19668 KB Execution killed with signal 11
82 Runtime error 130 ms 19600 KB Execution killed with signal 11
83 Runtime error 93 ms 19660 KB Execution killed with signal 11
84 Runtime error 97 ms 19660 KB Execution killed with signal 11
85 Runtime error 96 ms 19608 KB Execution killed with signal 11
86 Runtime error 95 ms 19660 KB Execution killed with signal 11
87 Runtime error 104 ms 19660 KB Execution killed with signal 11
88 Runtime error 95 ms 19616 KB Execution killed with signal 11
89 Runtime error 96 ms 19632 KB Execution killed with signal 11
90 Incorrect 82 ms 7892 KB Output isn't correct
91 Runtime error 95 ms 19656 KB Execution killed with signal 11
92 Runtime error 95 ms 19584 KB Execution killed with signal 11
93 Runtime error 94 ms 19580 KB Execution killed with signal 11
94 Runtime error 101 ms 19664 KB Execution killed with signal 11
95 Runtime error 95 ms 19660 KB Execution killed with signal 11
96 Runtime error 96 ms 19632 KB Execution killed with signal 11
97 Runtime error 103 ms 19668 KB Execution killed with signal 11
98 Runtime error 95 ms 19572 KB Execution killed with signal 11
99 Runtime error 97 ms 19660 KB Execution killed with signal 11
100 Runtime error 95 ms 19640 KB Execution killed with signal 11