Submission #107732

# Submission time Handle Problem Language Result Execution time Memory
107732 2019-04-25T15:03:10 Z Shafin666 Bomb (IZhO17_bomb) C++14
24 / 100
541 ms 7252 KB
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define  read_input         freopen("in.txt","r", stdin)
#define  print_output       freopen("out.txt","w", stdout)
typedef long long ll;
typedef long double ld;
using namespace std;

int main()
{   
    int n, m;
    char grid[2505][2505];

    cin >> n >> m;
    int w = 1e9+7, h = 1e9+7;

    for(int i = 1; i <= n; i++)  {
        for(int j = 1; j <= m; j++) {
            cin >> grid[i][j];
        }
    }

    for(int i = 1; i <= n; i++) {
        int len = 0; 
        for(int j = 1; j <= m; j++) {
            if(grid[i][j] == '1') len += 1;
            else {
                if(len) w = min(w, len);
                len = 0;
            }
        }
        if(len) w = min(w, len);
    }

    for(int i = 1; i <= m; i++) {
        int len = 0; 
        for(int j = 1; j <= n; j++) {
            if(grid[j][i] == '1') len += 1;
            else {
                if(len) h = min(h, len);
                len = 0;
            }
        }
        if(len) h = min(h, len);
    }   

    if(w > 2500) cout << 0 << endl;
    else cout << w * h << endl;

    return 0;   
} 
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 8 ms 6400 KB Output is correct
4 Correct 7 ms 6528 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Incorrect 3 ms 384 KB Output isn't correct
9 Incorrect 3 ms 384 KB Output isn't correct
10 Incorrect 2 ms 384 KB Output isn't correct
11 Incorrect 2 ms 384 KB Output isn't correct
12 Incorrect 2 ms 384 KB Output isn't correct
13 Correct 2 ms 384 KB Output is correct
14 Correct 0 ms 384 KB Output is correct
15 Incorrect 3 ms 384 KB Output isn't correct
16 Correct 2 ms 384 KB Output is correct
17 Correct 2 ms 512 KB Output is correct
18 Incorrect 3 ms 512 KB Output isn't correct
19 Incorrect 3 ms 512 KB Output isn't correct
20 Incorrect 4 ms 512 KB Output isn't correct
21 Incorrect 3 ms 512 KB Output isn't correct
22 Incorrect 3 ms 512 KB Output isn't correct
23 Incorrect 3 ms 512 KB Output isn't correct
24 Incorrect 2 ms 512 KB Output isn't correct
25 Incorrect 3 ms 512 KB Output isn't correct
26 Correct 3 ms 640 KB Output is correct
27 Correct 9 ms 1152 KB Output is correct
28 Incorrect 11 ms 1152 KB Output isn't correct
29 Incorrect 12 ms 1408 KB Output isn't correct
30 Incorrect 15 ms 1536 KB Output isn't correct
31 Incorrect 13 ms 1280 KB Output isn't correct
32 Incorrect 16 ms 1408 KB Output isn't correct
33 Incorrect 14 ms 1656 KB Output isn't correct
34 Incorrect 10 ms 1280 KB Output isn't correct
35 Incorrect 14 ms 1664 KB Output isn't correct
36 Correct 15 ms 1664 KB Output is correct
37 Incorrect 2 ms 384 KB Output isn't correct
38 Correct 395 ms 7160 KB Output is correct
39 Incorrect 2 ms 460 KB Output isn't correct
40 Incorrect 54 ms 2936 KB Output isn't correct
41 Incorrect 3 ms 384 KB Output isn't correct
42 Incorrect 3 ms 512 KB Output isn't correct
43 Correct 384 ms 7032 KB Output is correct
44 Incorrect 17 ms 1664 KB Output isn't correct
45 Incorrect 405 ms 7252 KB Output isn't correct
46 Correct 424 ms 6884 KB Output is correct
47 Incorrect 451 ms 6988 KB Output isn't correct
48 Incorrect 414 ms 7032 KB Output isn't correct
49 Correct 432 ms 7012 KB Output is correct
50 Incorrect 441 ms 7028 KB Output isn't correct
51 Incorrect 409 ms 6904 KB Output isn't correct
52 Incorrect 522 ms 7032 KB Output isn't correct
53 Incorrect 442 ms 7032 KB Output isn't correct
54 Incorrect 418 ms 6956 KB Output isn't correct
55 Incorrect 497 ms 6952 KB Output isn't correct
56 Correct 426 ms 7032 KB Output is correct
57 Incorrect 432 ms 7064 KB Output isn't correct
58 Incorrect 428 ms 6904 KB Output isn't correct
59 Incorrect 431 ms 7036 KB Output isn't correct
60 Correct 426 ms 7004 KB Output is correct
61 Correct 367 ms 7036 KB Output is correct
62 Correct 428 ms 7080 KB Output is correct
63 Correct 451 ms 7004 KB Output is correct
64 Correct 426 ms 6948 KB Output is correct
65 Incorrect 418 ms 7032 KB Output isn't correct
66 Incorrect 469 ms 6984 KB Output isn't correct
67 Incorrect 383 ms 6904 KB Output isn't correct
68 Incorrect 481 ms 6924 KB Output isn't correct
69 Incorrect 436 ms 7032 KB Output isn't correct
70 Incorrect 279 ms 5828 KB Output isn't correct
71 Incorrect 398 ms 7032 KB Output isn't correct
72 Incorrect 491 ms 7048 KB Output isn't correct
73 Incorrect 387 ms 7068 KB Output isn't correct
74 Incorrect 409 ms 6980 KB Output isn't correct
75 Incorrect 425 ms 7024 KB Output isn't correct
76 Incorrect 435 ms 7000 KB Output isn't correct
77 Incorrect 442 ms 6960 KB Output isn't correct
78 Incorrect 393 ms 7032 KB Output isn't correct
79 Incorrect 434 ms 6936 KB Output isn't correct
80 Incorrect 468 ms 6936 KB Output isn't correct
81 Incorrect 457 ms 7032 KB Output isn't correct
82 Incorrect 467 ms 6884 KB Output isn't correct
83 Incorrect 460 ms 7160 KB Output isn't correct
84 Incorrect 477 ms 7000 KB Output isn't correct
85 Incorrect 530 ms 7072 KB Output isn't correct
86 Incorrect 404 ms 7032 KB Output isn't correct
87 Incorrect 392 ms 7004 KB Output isn't correct
88 Incorrect 414 ms 6964 KB Output isn't correct
89 Incorrect 384 ms 6904 KB Output isn't correct
90 Incorrect 243 ms 5800 KB Output isn't correct
91 Incorrect 399 ms 6904 KB Output isn't correct
92 Incorrect 541 ms 7112 KB Output isn't correct
93 Incorrect 454 ms 6928 KB Output isn't correct
94 Incorrect 439 ms 6956 KB Output isn't correct
95 Incorrect 435 ms 7188 KB Output isn't correct
96 Incorrect 487 ms 7032 KB Output isn't correct
97 Incorrect 458 ms 7032 KB Output isn't correct
98 Incorrect 435 ms 7024 KB Output isn't correct
99 Incorrect 490 ms 7032 KB Output isn't correct
100 Incorrect 382 ms 7024 KB Output isn't correct