Submission #171837

# Submission time Handle Problem Language Result Execution time Memory
171837 2019-12-30T13:19:47 Z achibasadzishvili Bomb (IZhO17_bomb) C++14
24 / 100
223 ms 31128 KB
#include<bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define pb push_back
using namespace std;
ll n,m;
int a[2505][2505];
int main(){
    ios::sync_with_stdio(false);
    cin >> n >> m;
    for(int i=1; i<=n; i++){
        for(int j=1; j<=m; j++){
            char x;
            cin >> x;
            a[i][j] = (x == '1');
        }
    }
    
    ll indx = 1000000;
    for(int i=1; i<=n; i++){
        ll las = 0;
        for(int j=1; j<=m; j++){
            if(a[i][j] == 0){
                las = j;
                continue;
            }
            if(a[i][j + 1] == 0){
                indx = min(indx , j - las);
            }
        }
    }
    
    ll indy = 1000000;
    
    for(int i=1; i<=m; i++){
        ll las = 0;
        for(int j=1; j<=n; j++){
            if(a[j][i] == 0){
                las = j;
                continue;
            }
            if(a[j + 1][i] == 0){
                indy = min(indy , j - las);
            }
        }
    }
    
    cout << indx * indy << '\n';
    
    
    
    return 0;
}
# 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 10 ms 10360 KB Output is correct
4 Correct 10 ms 10492 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 380 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 376 KB Output is correct
17 Correct 2 ms 632 KB Output is correct
18 Incorrect 2 ms 632 KB Output isn't correct
19 Incorrect 2 ms 760 KB Output isn't correct
20 Incorrect 2 ms 760 KB Output isn't correct
21 Incorrect 2 ms 632 KB Output isn't correct
22 Incorrect 2 ms 760 KB Output isn't correct
23 Incorrect 3 ms 764 KB Output isn't correct
24 Incorrect 2 ms 760 KB Output isn't correct
25 Incorrect 2 ms 760 KB Output isn't correct
26 Correct 3 ms 760 KB Output is correct
27 Correct 5 ms 1912 KB Output is correct
28 Incorrect 6 ms 2040 KB Output isn't correct
29 Incorrect 6 ms 2552 KB Output isn't correct
30 Incorrect 8 ms 2936 KB Output isn't correct
31 Incorrect 7 ms 2424 KB Output isn't correct
32 Incorrect 7 ms 2680 KB Output isn't correct
33 Incorrect 9 ms 3064 KB Output isn't correct
34 Incorrect 5 ms 2168 KB Output isn't correct
35 Incorrect 9 ms 3064 KB Output isn't correct
36 Correct 9 ms 3064 KB Output is correct
37 Incorrect 2 ms 504 KB Output isn't correct
38 Correct 217 ms 30672 KB Output is correct
39 Incorrect 2 ms 376 KB Output isn't correct
40 Incorrect 26 ms 7676 KB Output isn't correct
41 Incorrect 2 ms 504 KB Output isn't correct
42 Incorrect 3 ms 764 KB Output isn't correct
43 Correct 201 ms 31116 KB Output is correct
44 Incorrect 9 ms 3064 KB Output isn't correct
45 Incorrect 199 ms 29724 KB Output isn't correct
46 Correct 210 ms 30968 KB Output is correct
47 Incorrect 200 ms 31004 KB Output isn't correct
48 Incorrect 198 ms 28904 KB Output isn't correct
49 Correct 205 ms 30604 KB Output is correct
50 Incorrect 200 ms 30912 KB Output isn't correct
51 Incorrect 200 ms 30964 KB Output isn't correct
52 Incorrect 201 ms 29944 KB Output isn't correct
53 Incorrect 199 ms 30996 KB Output isn't correct
54 Incorrect 213 ms 30908 KB Output isn't correct
55 Incorrect 210 ms 31012 KB Output isn't correct
56 Correct 204 ms 30336 KB Output is correct
57 Incorrect 196 ms 31008 KB Output isn't correct
58 Incorrect 200 ms 30924 KB Output isn't correct
59 Incorrect 196 ms 31084 KB Output isn't correct
60 Correct 200 ms 30916 KB Output is correct
61 Correct 202 ms 30948 KB Output is correct
62 Correct 204 ms 30972 KB Output is correct
63 Correct 205 ms 31008 KB Output is correct
64 Correct 200 ms 31116 KB Output is correct
65 Incorrect 212 ms 30984 KB Output isn't correct
66 Incorrect 200 ms 30592 KB Output isn't correct
67 Incorrect 202 ms 31128 KB Output isn't correct
68 Incorrect 201 ms 30944 KB Output isn't correct
69 Incorrect 196 ms 31000 KB Output isn't correct
70 Incorrect 124 ms 23932 KB Output isn't correct
71 Incorrect 195 ms 30940 KB Output isn't correct
72 Incorrect 200 ms 30244 KB Output isn't correct
73 Incorrect 198 ms 30968 KB Output isn't correct
74 Incorrect 185 ms 30940 KB Output isn't correct
75 Incorrect 199 ms 30968 KB Output isn't correct
76 Incorrect 198 ms 29560 KB Output isn't correct
77 Incorrect 197 ms 30996 KB Output isn't correct
78 Incorrect 222 ms 29556 KB Output isn't correct
79 Incorrect 211 ms 30888 KB Output isn't correct
80 Incorrect 194 ms 31096 KB Output isn't correct
81 Incorrect 194 ms 30984 KB Output isn't correct
82 Incorrect 201 ms 30968 KB Output isn't correct
83 Incorrect 198 ms 30968 KB Output isn't correct
84 Incorrect 194 ms 31096 KB Output isn't correct
85 Incorrect 200 ms 31036 KB Output isn't correct
86 Incorrect 204 ms 30988 KB Output isn't correct
87 Incorrect 197 ms 30968 KB Output isn't correct
88 Incorrect 197 ms 30968 KB Output isn't correct
89 Incorrect 200 ms 31008 KB Output isn't correct
90 Incorrect 125 ms 23928 KB Output isn't correct
91 Incorrect 223 ms 31024 KB Output isn't correct
92 Incorrect 207 ms 30968 KB Output isn't correct
93 Incorrect 202 ms 30968 KB Output isn't correct
94 Incorrect 222 ms 30888 KB Output isn't correct
95 Incorrect 199 ms 30968 KB Output isn't correct
96 Incorrect 200 ms 30996 KB Output isn't correct
97 Incorrect 204 ms 30924 KB Output isn't correct
98 Incorrect 199 ms 31024 KB Output isn't correct
99 Incorrect 198 ms 31060 KB Output isn't correct
100 Incorrect 202 ms 30920 KB Output isn't correct