# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
877333 | 2023-11-23T06:41:53 Z | marcid | Bomb (IZhO17_bomb) | C++17 | 244 ms | 6756 KB |
#include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 2501; char field[maxn][maxn]; int mn1=maxn,mn2=maxn; int count(string s) { int cnt = 0; int best = 0; bool ret = false; for (int i = 1; i < s.size(); i++) { if (s[i] == '1' || s[i-1]=='1') ret=true; if (s[i-1]==s[i] && s[i]=='1') cnt++; else cnt=0; best=max(best,cnt); } return (ret ? best+1 : 0); } signed main() { int n,m; cin >> n >> m; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> field[i][j]; } } for (int i = 1; i <= n; i++) { string t=""; for (int j = 1; j <= m; j++) t+=field[i][j]; int x = count(t); if (x>0) mn1=min(mn1,x); } for (int j = 1; j <= m; j++) { string t=""; for (int i = 1; i <= n; i++) t+=field[i][j]; int x = count(t); if (x>0) mn2=min(mn2, x); } cout << mn1 * mn2 << '\n'; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Incorrect | 0 ms | 348 KB | Output isn't correct |
3 | Incorrect | 1 ms | 6492 KB | Output isn't correct |
4 | Incorrect | 2 ms | 6492 KB | Output isn't correct |
5 | Incorrect | 0 ms | 348 KB | Output isn't correct |
6 | Incorrect | 0 ms | 348 KB | Output isn't correct |
7 | Correct | 0 ms | 344 KB | Output is correct |
8 | Incorrect | 0 ms | 348 KB | Output isn't correct |
9 | Incorrect | 0 ms | 348 KB | Output isn't correct |
10 | Incorrect | 0 ms | 348 KB | Output isn't correct |
11 | Incorrect | 0 ms | 348 KB | Output isn't correct |
12 | Incorrect | 0 ms | 348 KB | Output isn't correct |
13 | Correct | 0 ms | 348 KB | Output is correct |
14 | Correct | 0 ms | 348 KB | Output is correct |
15 | Incorrect | 0 ms | 348 KB | Output isn't correct |
16 | Incorrect | 0 ms | 348 KB | Output isn't correct |
17 | Correct | 1 ms | 604 KB | Output is correct |
18 | Incorrect | 0 ms | 604 KB | Output isn't correct |
19 | Incorrect | 1 ms | 2652 KB | Output isn't correct |
20 | Incorrect | 1 ms | 2652 KB | Output isn't correct |
21 | Incorrect | 1 ms | 348 KB | Output isn't correct |
22 | Incorrect | 1 ms | 2652 KB | Output isn't correct |
23 | Incorrect | 1 ms | 2652 KB | Output isn't correct |
24 | Incorrect | 1 ms | 2652 KB | Output isn't correct |
25 | Incorrect | 1 ms | 2652 KB | Output isn't correct |
26 | Incorrect | 1 ms | 2648 KB | Output isn't correct |
27 | Incorrect | 4 ms | 2668 KB | Output isn't correct |
28 | Incorrect | 5 ms | 2652 KB | Output isn't correct |
29 | Incorrect | 5 ms | 2652 KB | Output isn't correct |
30 | Incorrect | 7 ms | 2652 KB | Output isn't correct |
31 | Incorrect | 6 ms | 2668 KB | Output isn't correct |
32 | Incorrect | 6 ms | 2652 KB | Output isn't correct |
33 | Incorrect | 8 ms | 2672 KB | Output isn't correct |
34 | Incorrect | 3 ms | 2652 KB | Output isn't correct |
35 | Incorrect | 8 ms | 2652 KB | Output isn't correct |
36 | Incorrect | 10 ms | 2652 KB | Output isn't correct |
37 | Incorrect | 0 ms | 348 KB | Output isn't correct |
38 | Correct | 225 ms | 6480 KB | Output is correct |
39 | Incorrect | 0 ms | 348 KB | Output isn't correct |
40 | Incorrect | 32 ms | 2652 KB | Output isn't correct |
41 | Incorrect | 0 ms | 348 KB | Output isn't correct |
42 | Incorrect | 1 ms | 2652 KB | Output isn't correct |
43 | Correct | 225 ms | 6504 KB | Output is correct |
44 | Incorrect | 8 ms | 2648 KB | Output isn't correct |
45 | Incorrect | 228 ms | 6504 KB | Output isn't correct |
46 | Correct | 225 ms | 6484 KB | Output is correct |
47 | Incorrect | 225 ms | 6480 KB | Output isn't correct |
48 | Incorrect | 228 ms | 6736 KB | Output isn't correct |
49 | Incorrect | 228 ms | 6332 KB | Output isn't correct |
50 | Incorrect | 227 ms | 6480 KB | Output isn't correct |
51 | Incorrect | 232 ms | 6500 KB | Output isn't correct |
52 | Incorrect | 226 ms | 6392 KB | Output isn't correct |
53 | Incorrect | 227 ms | 6492 KB | Output isn't correct |
54 | Incorrect | 234 ms | 6392 KB | Output isn't correct |
55 | Incorrect | 237 ms | 6484 KB | Output isn't correct |
56 | Correct | 226 ms | 6544 KB | Output is correct |
57 | Incorrect | 228 ms | 6480 KB | Output isn't correct |
58 | Incorrect | 236 ms | 6508 KB | Output isn't correct |
59 | Incorrect | 225 ms | 6544 KB | Output isn't correct |
60 | Incorrect | 231 ms | 6500 KB | Output isn't correct |
61 | Incorrect | 228 ms | 6364 KB | Output isn't correct |
62 | Incorrect | 236 ms | 6756 KB | Output isn't correct |
63 | Incorrect | 226 ms | 6548 KB | Output isn't correct |
64 | Incorrect | 226 ms | 6480 KB | Output isn't correct |
65 | Incorrect | 230 ms | 6496 KB | Output isn't correct |
66 | Incorrect | 236 ms | 6488 KB | Output isn't correct |
67 | Incorrect | 229 ms | 6408 KB | Output isn't correct |
68 | Incorrect | 232 ms | 6424 KB | Output isn't correct |
69 | Incorrect | 228 ms | 6484 KB | Output isn't correct |
70 | Incorrect | 145 ms | 5204 KB | Output isn't correct |
71 | Incorrect | 234 ms | 6740 KB | Output isn't correct |
72 | Incorrect | 225 ms | 6500 KB | Output isn't correct |
73 | Incorrect | 224 ms | 6500 KB | Output isn't correct |
74 | Incorrect | 232 ms | 6492 KB | Output isn't correct |
75 | Incorrect | 235 ms | 6376 KB | Output isn't correct |
76 | Incorrect | 238 ms | 6748 KB | Output isn't correct |
77 | Incorrect | 228 ms | 6480 KB | Output isn't correct |
78 | Incorrect | 224 ms | 6484 KB | Output isn't correct |
79 | Incorrect | 234 ms | 6748 KB | Output isn't correct |
80 | Incorrect | 227 ms | 6308 KB | Output isn't correct |
81 | Incorrect | 226 ms | 6480 KB | Output isn't correct |
82 | Incorrect | 234 ms | 6740 KB | Output isn't correct |
83 | Incorrect | 228 ms | 6500 KB | Output isn't correct |
84 | Incorrect | 224 ms | 6736 KB | Output isn't correct |
85 | Incorrect | 236 ms | 6688 KB | Output isn't correct |
86 | Incorrect | 237 ms | 6480 KB | Output isn't correct |
87 | Incorrect | 239 ms | 6740 KB | Output isn't correct |
88 | Incorrect | 225 ms | 6480 KB | Output isn't correct |
89 | Incorrect | 228 ms | 6480 KB | Output isn't correct |
90 | Incorrect | 151 ms | 5456 KB | Output isn't correct |
91 | Incorrect | 237 ms | 6492 KB | Output isn't correct |
92 | Incorrect | 226 ms | 6508 KB | Output isn't correct |
93 | Incorrect | 237 ms | 6740 KB | Output isn't correct |
94 | Incorrect | 230 ms | 6480 KB | Output isn't correct |
95 | Incorrect | 244 ms | 6540 KB | Output isn't correct |
96 | Incorrect | 229 ms | 6488 KB | Output isn't correct |
97 | Incorrect | 228 ms | 6468 KB | Output isn't correct |
98 | Incorrect | 227 ms | 6480 KB | Output isn't correct |
99 | Incorrect | 238 ms | 6492 KB | Output isn't correct |
100 | Incorrect | 225 ms | 6480 KB | Output isn't correct |