답안 #88571

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
88571 2018-12-06T17:32:10 Z Bodo171 Bomb (IZhO17_bomb) C++14
12 / 100
34 ms 111060 KB
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const int nmax=2005;
string s[nmax];
int n,m,i,j,p,mn1,mn2;
int main()
{
    ios_base::sync_with_stdio(false);
    cin>>n>>m;
    for(i=1;i<=n;i++)
    {
        cin>>s[i];
        s[i]="0"+s[i]+"0";
    }
    for(i=1;i<=m+2;i++)
        s[0]+='0',s[n+1]+='0';
    mn1=n+m,mn2=n+m;
    for(i=1;i<=n;i++)
        for(j=1;j<=m;j++)
    {
        if(s[i][j]=='1'&&s[i][j-1]=='0')
        {
            p=j;
            while(s[i][p]=='1')
                p++;
            if(p-j<mn1)
                mn1=p-j;
        }
        if(s[i][j]=='1'&&s[i-1][j]=='0')
        {
            p=i;
            while(s[p][j]=='1')
                p++;
            if(p-i<mn2)
                mn2=p-i;
        }
    }
    if(mn1==n+m)
        cout<<"0";
    else cout<<mn1*mn2;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 532 KB Output is correct
3 Runtime error 3 ms 680 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 3 ms 756 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Correct 2 ms 816 KB Output is correct
6 Correct 2 ms 972 KB Output is correct
7 Correct 2 ms 972 KB Output is correct
8 Incorrect 2 ms 1072 KB Output isn't correct
9 Incorrect 2 ms 1072 KB Output isn't correct
10 Incorrect 2 ms 1072 KB Output isn't correct
11 Incorrect 2 ms 1072 KB Output isn't correct
12 Incorrect 2 ms 1072 KB Output isn't correct
13 Correct 3 ms 1072 KB Output is correct
14 Correct 2 ms 1072 KB Output is correct
15 Incorrect 2 ms 1072 KB Output isn't correct
16 Correct 2 ms 1072 KB Output is correct
17 Correct 2 ms 1072 KB Output is correct
18 Incorrect 2 ms 1072 KB Output isn't correct
19 Incorrect 2 ms 1072 KB Output isn't correct
20 Incorrect 2 ms 1072 KB Output isn't correct
21 Incorrect 2 ms 1072 KB Output isn't correct
22 Incorrect 2 ms 1136 KB Output isn't correct
23 Incorrect 2 ms 1136 KB Output isn't correct
24 Incorrect 2 ms 1152 KB Output isn't correct
25 Incorrect 2 ms 1152 KB Output isn't correct
26 Correct 2 ms 1160 KB Output is correct
27 Correct 3 ms 1304 KB Output is correct
28 Incorrect 3 ms 1480 KB Output isn't correct
29 Incorrect 3 ms 1592 KB Output isn't correct
30 Incorrect 3 ms 1844 KB Output isn't correct
31 Incorrect 3 ms 2020 KB Output isn't correct
32 Incorrect 3 ms 2168 KB Output isn't correct
33 Incorrect 3 ms 2324 KB Output isn't correct
34 Incorrect 3 ms 2324 KB Output isn't correct
35 Incorrect 3 ms 2472 KB Output isn't correct
36 Correct 4 ms 2472 KB Output is correct
37 Incorrect 2 ms 2472 KB Output isn't correct
38 Runtime error 31 ms 26840 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Incorrect 2 ms 26840 KB Output isn't correct
40 Incorrect 9 ms 26840 KB Output isn't correct
41 Incorrect 2 ms 26840 KB Output isn't correct
42 Incorrect 2 ms 26840 KB Output isn't correct
43 Runtime error 32 ms 32672 KB Execution killed with signal 11 (could be triggered by violating memory limits)
44 Incorrect 4 ms 32672 KB Output isn't correct
45 Runtime error 33 ms 37824 KB Execution killed with signal 11 (could be triggered by violating memory limits)
46 Runtime error 31 ms 43024 KB Execution killed with signal 11 (could be triggered by violating memory limits)
47 Runtime error 31 ms 45740 KB Execution killed with signal 11 (could be triggered by violating memory limits)
48 Runtime error 30 ms 45740 KB Execution killed with signal 11 (could be triggered by violating memory limits)
49 Runtime error 31 ms 45940 KB Execution killed with signal 11 (could be triggered by violating memory limits)
50 Runtime error 32 ms 49488 KB Execution killed with signal 11 (could be triggered by violating memory limits)
51 Runtime error 32 ms 49644 KB Execution killed with signal 11 (could be triggered by violating memory limits)
52 Runtime error 32 ms 54704 KB Execution killed with signal 11 (could be triggered by violating memory limits)
53 Runtime error 33 ms 59796 KB Execution killed with signal 11 (could be triggered by violating memory limits)
54 Runtime error 33 ms 64928 KB Execution killed with signal 11 (could be triggered by violating memory limits)
55 Runtime error 32 ms 67408 KB Execution killed with signal 11 (could be triggered by violating memory limits)
56 Runtime error 32 ms 72520 KB Execution killed with signal 11 (could be triggered by violating memory limits)
57 Runtime error 31 ms 75148 KB Execution killed with signal 11 (could be triggered by violating memory limits)
58 Runtime error 31 ms 75148 KB Execution killed with signal 11 (could be triggered by violating memory limits)
59 Runtime error 31 ms 75148 KB Execution killed with signal 11 (could be triggered by violating memory limits)
60 Runtime error 31 ms 80248 KB Execution killed with signal 11 (could be triggered by violating memory limits)
61 Runtime error 32 ms 83620 KB Execution killed with signal 11 (could be triggered by violating memory limits)
62 Runtime error 29 ms 83620 KB Execution killed with signal 11 (could be triggered by violating memory limits)
63 Runtime error 32 ms 83620 KB Execution killed with signal 11 (could be triggered by violating memory limits)
64 Runtime error 32 ms 83620 KB Execution killed with signal 11 (could be triggered by violating memory limits)
65 Runtime error 32 ms 83620 KB Execution killed with signal 11 (could be triggered by violating memory limits)
66 Runtime error 31 ms 83944 KB Execution killed with signal 11 (could be triggered by violating memory limits)
67 Runtime error 32 ms 83944 KB Execution killed with signal 11 (could be triggered by violating memory limits)
68 Runtime error 30 ms 83944 KB Execution killed with signal 11 (could be triggered by violating memory limits)
69 Runtime error 32 ms 83944 KB Execution killed with signal 11 (could be triggered by violating memory limits)
70 Incorrect 22 ms 83944 KB Output isn't correct
71 Runtime error 33 ms 84928 KB Execution killed with signal 11 (could be triggered by violating memory limits)
72 Runtime error 33 ms 90132 KB Execution killed with signal 11 (could be triggered by violating memory limits)
73 Runtime error 33 ms 92852 KB Execution killed with signal 11 (could be triggered by violating memory limits)
74 Runtime error 29 ms 92852 KB Execution killed with signal 11 (could be triggered by violating memory limits)
75 Runtime error 31 ms 92852 KB Execution killed with signal 11 (could be triggered by violating memory limits)
76 Runtime error 31 ms 92904 KB Execution killed with signal 11 (could be triggered by violating memory limits)
77 Runtime error 30 ms 92904 KB Execution killed with signal 11 (could be triggered by violating memory limits)
78 Runtime error 32 ms 92904 KB Execution killed with signal 11 (could be triggered by violating memory limits)
79 Runtime error 33 ms 92904 KB Execution killed with signal 11 (could be triggered by violating memory limits)
80 Runtime error 30 ms 92904 KB Execution killed with signal 11 (could be triggered by violating memory limits)
81 Runtime error 33 ms 92904 KB Execution killed with signal 11 (could be triggered by violating memory limits)
82 Runtime error 32 ms 92904 KB Execution killed with signal 11 (could be triggered by violating memory limits)
83 Runtime error 33 ms 97156 KB Execution killed with signal 11 (could be triggered by violating memory limits)
84 Runtime error 33 ms 102276 KB Execution killed with signal 11 (could be triggered by violating memory limits)
85 Runtime error 32 ms 102276 KB Execution killed with signal 11 (could be triggered by violating memory limits)
86 Runtime error 31 ms 102276 KB Execution killed with signal 11 (could be triggered by violating memory limits)
87 Runtime error 33 ms 102276 KB Execution killed with signal 11 (could be triggered by violating memory limits)
88 Runtime error 32 ms 102276 KB Execution killed with signal 11 (could be triggered by violating memory limits)
89 Runtime error 32 ms 102276 KB Execution killed with signal 11 (could be triggered by violating memory limits)
90 Incorrect 23 ms 102276 KB Output isn't correct
91 Runtime error 32 ms 102356 KB Execution killed with signal 11 (could be triggered by violating memory limits)
92 Runtime error 32 ms 102368 KB Execution killed with signal 11 (could be triggered by violating memory limits)
93 Runtime error 34 ms 102368 KB Execution killed with signal 11 (could be triggered by violating memory limits)
94 Runtime error 33 ms 103120 KB Execution killed with signal 11 (could be triggered by violating memory limits)
95 Runtime error 33 ms 108224 KB Execution killed with signal 11 (could be triggered by violating memory limits)
96 Runtime error 32 ms 111020 KB Execution killed with signal 11 (could be triggered by violating memory limits)
97 Runtime error 32 ms 111032 KB Execution killed with signal 11 (could be triggered by violating memory limits)
98 Runtime error 31 ms 111044 KB Execution killed with signal 11 (could be triggered by violating memory limits)
99 Runtime error 32 ms 111044 KB Execution killed with signal 11 (could be triggered by violating memory limits)
100 Runtime error 32 ms 111060 KB Execution killed with signal 11 (could be triggered by violating memory limits)