Submission #107729

# Submission time Handle Problem Language Result Execution time Memory
107729 2019-04-25T14:58:44 Z Shafin666 Bomb (IZhO17_bomb) C++14
24 / 100
476 ms 12792 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);
    }   

    cout << w * h << endl;

    return 0;   
} 
# Verdict Execution time Memory Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 7 ms 6528 KB Output is correct
4 Correct 9 ms 6528 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 3 ms 256 KB Output is correct
7 Correct 3 ms 384 KB Output is correct
8 Incorrect 3 ms 384 KB Output isn't correct
9 Incorrect 5 ms 384 KB Output isn't correct
10 Incorrect 3 ms 512 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 2 ms 384 KB Output is correct
15 Incorrect 4 ms 384 KB Output isn't correct
16 Correct 2 ms 384 KB Output is correct
17 Correct 3 ms 512 KB Output is correct
18 Incorrect 2 ms 512 KB Output isn't correct
19 Incorrect 4 ms 640 KB Output isn't correct
20 Incorrect 3 ms 512 KB Output isn't correct
21 Incorrect 3 ms 512 KB Output isn't correct
22 Incorrect 4 ms 512 KB Output isn't correct
23 Incorrect 3 ms 512 KB Output isn't correct
24 Incorrect 3 ms 512 KB Output isn't correct
25 Incorrect 3 ms 640 KB Output isn't correct
26 Correct 3 ms 512 KB Output is correct
27 Correct 10 ms 1200 KB Output is correct
28 Incorrect 13 ms 1152 KB Output isn't correct
29 Incorrect 11 ms 1408 KB Output isn't correct
30 Incorrect 14 ms 1536 KB Output isn't correct
31 Incorrect 16 ms 1280 KB Output isn't correct
32 Incorrect 12 ms 1408 KB Output isn't correct
33 Incorrect 15 ms 1664 KB Output isn't correct
34 Incorrect 8 ms 1280 KB Output isn't correct
35 Incorrect 17 ms 1784 KB Output isn't correct
36 Correct 15 ms 1536 KB Output is correct
37 Incorrect 2 ms 384 KB Output isn't correct
38 Correct 391 ms 12648 KB Output is correct
39 Incorrect 2 ms 384 KB Output isn't correct
40 Incorrect 48 ms 3192 KB Output isn't correct
41 Incorrect 2 ms 384 KB Output isn't correct
42 Incorrect 3 ms 640 KB Output isn't correct
43 Correct 456 ms 12536 KB Output is correct
44 Incorrect 16 ms 1664 KB Output isn't correct
45 Incorrect 402 ms 12636 KB Output isn't correct
46 Correct 396 ms 12628 KB Output is correct
47 Incorrect 382 ms 12792 KB Output isn't correct
48 Incorrect 413 ms 12772 KB Output isn't correct
49 Correct 393 ms 12684 KB Output is correct
50 Incorrect 444 ms 12676 KB Output isn't correct
51 Incorrect 401 ms 12556 KB Output isn't correct
52 Incorrect 452 ms 12564 KB Output isn't correct
53 Incorrect 421 ms 12664 KB Output isn't correct
54 Incorrect 462 ms 12596 KB Output isn't correct
55 Incorrect 461 ms 12776 KB Output isn't correct
56 Correct 367 ms 12644 KB Output is correct
57 Incorrect 355 ms 12664 KB Output isn't correct
58 Incorrect 380 ms 12648 KB Output isn't correct
59 Incorrect 437 ms 12716 KB Output isn't correct
60 Correct 398 ms 12576 KB Output is correct
61 Correct 365 ms 12540 KB Output is correct
62 Correct 408 ms 12668 KB Output is correct
63 Correct 375 ms 12664 KB Output is correct
64 Correct 418 ms 12792 KB Output is correct
65 Incorrect 441 ms 12696 KB Output isn't correct
66 Incorrect 424 ms 12664 KB Output isn't correct
67 Incorrect 425 ms 12540 KB Output isn't correct
68 Incorrect 413 ms 12664 KB Output isn't correct
69 Incorrect 350 ms 12664 KB Output isn't correct
70 Incorrect 221 ms 9208 KB Output isn't correct
71 Incorrect 369 ms 12792 KB Output isn't correct
72 Incorrect 355 ms 12536 KB Output isn't correct
73 Incorrect 411 ms 12536 KB Output isn't correct
74 Incorrect 430 ms 12668 KB Output isn't correct
75 Incorrect 403 ms 12792 KB Output isn't correct
76 Incorrect 389 ms 12652 KB Output isn't correct
77 Incorrect 469 ms 12728 KB Output isn't correct
78 Incorrect 476 ms 12792 KB Output isn't correct
79 Incorrect 468 ms 12596 KB Output isn't correct
80 Incorrect 432 ms 12536 KB Output isn't correct
81 Incorrect 415 ms 12764 KB Output isn't correct
82 Incorrect 389 ms 12712 KB Output isn't correct
83 Incorrect 370 ms 12612 KB Output isn't correct
84 Incorrect 401 ms 12712 KB Output isn't correct
85 Incorrect 403 ms 12536 KB Output isn't correct
86 Incorrect 476 ms 12792 KB Output isn't correct
87 Incorrect 384 ms 12580 KB Output isn't correct
88 Incorrect 387 ms 12752 KB Output isn't correct
89 Incorrect 458 ms 12792 KB Output isn't correct
90 Incorrect 237 ms 9412 KB Output isn't correct
91 Incorrect 375 ms 12684 KB Output isn't correct
92 Incorrect 407 ms 12664 KB Output isn't correct
93 Incorrect 433 ms 12692 KB Output isn't correct
94 Incorrect 403 ms 12792 KB Output isn't correct
95 Incorrect 384 ms 12584 KB Output isn't correct
96 Incorrect 387 ms 12644 KB Output isn't correct
97 Incorrect 381 ms 12740 KB Output isn't correct
98 Incorrect 460 ms 12536 KB Output isn't correct
99 Incorrect 390 ms 12764 KB Output isn't correct
100 Incorrect 449 ms 12792 KB Output isn't correct