Submission #333957

# Submission time Handle Problem Language Result Execution time Memory
333957 2020-12-08T04:00:49 Z beksultan04 Bomb (IZhO17_bomb) C++14
5 / 100
516 ms 49652 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define OK puts("OK");
#define fr first
#define sc second
#define ret return
#define scan1(a) scanf("%lld",&a);
#define scan2(a,b) scanf("%lld %lld",&a, &b);
#define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define pb push_back
#define endi puts("");
const int N = 1e6+12,INF=1e9+7;
int q[2501][2501],v[2501][2501],p[2501][2501],gor[N],ver[N];



main(){
    int m,i,j,k,c=0,n,x=INF,y=INF;
    scan2(n,m)
    for (i=1;i<=n;++i)
        for (j=1;j<=m;++j){
            char ch;
            cin>>ch;
            q[i][j]=ch-'0';
        }

    for (i=1;i<=n;++i){
        for (j=1;j<=m;++j){
            if (q[i][j]){
                c++;
            }
            else if (c!=0){
                x = min(c,x);
                c=0;
            }
        }
    }
    if (c!= 0)
        x = min(c,x);
    c=0;
    for (i=1;i<=m;++i){
        for (j=1;j<=n;++j){
            if (q[j][i]){
                c++;
            }
            else if (c!=0){
                y = min(c,y);
                c=0;
            }
        }
    }
    if (c!= 0)
        y = min(c,y);
    cout <<y*x<<" ";
}




Compilation message

bomb.cpp:20:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   20 | main(){
      |      ^
bomb.cpp: In function 'int main()':
bomb.cpp:21:15: warning: unused variable 'k' [-Wunused-variable]
   21 |     int m,i,j,k,c=0,n,x=INF,y=INF;
      |               ^
bomb.cpp:10:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 | #define scan2(a,b) scanf("%lld %lld",&a, &b);
      |                    ~~~~~^~~~~~~~~~~~~~~~~~~~
bomb.cpp:22:5: note: in expansion of macro 'scan2'
   22 |     scan2(n,m)
      |     ^~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Incorrect 0 ms 364 KB Output isn't correct
3 Incorrect 6 ms 10348 KB Output isn't correct
4 Incorrect 6 ms 10348 KB Output isn't correct
5 Incorrect 1 ms 364 KB Output isn't correct
6 Incorrect 1 ms 364 KB Output isn't correct
7 Incorrect 0 ms 364 KB Output isn't correct
8 Incorrect 1 ms 364 KB Output isn't correct
9 Incorrect 1 ms 364 KB Output isn't correct
10 Incorrect 1 ms 364 KB Output isn't correct
11 Incorrect 1 ms 364 KB Output isn't correct
12 Incorrect 1 ms 364 KB Output isn't correct
13 Correct 1 ms 364 KB Output is correct
14 Correct 1 ms 364 KB Output is correct
15 Incorrect 1 ms 364 KB Output isn't correct
16 Incorrect 1 ms 364 KB Output isn't correct
17 Correct 1 ms 620 KB Output is correct
18 Incorrect 1 ms 620 KB Output isn't correct
19 Incorrect 1 ms 748 KB Output isn't correct
20 Incorrect 1 ms 748 KB Output isn't correct
21 Incorrect 1 ms 620 KB Output isn't correct
22 Incorrect 1 ms 620 KB Output isn't correct
23 Incorrect 1 ms 748 KB Output isn't correct
24 Incorrect 1 ms 748 KB Output isn't correct
25 Incorrect 1 ms 748 KB Output isn't correct
26 Incorrect 2 ms 748 KB Output isn't correct
27 Incorrect 8 ms 2156 KB Output isn't correct
28 Incorrect 9 ms 2412 KB Output isn't correct
29 Incorrect 10 ms 2924 KB Output isn't correct
30 Incorrect 14 ms 3564 KB Output isn't correct
31 Incorrect 12 ms 2796 KB Output isn't correct
32 Incorrect 13 ms 3180 KB Output isn't correct
33 Incorrect 15 ms 3692 KB Output isn't correct
34 Incorrect 7 ms 2412 KB Output isn't correct
35 Incorrect 15 ms 3692 KB Output isn't correct
36 Incorrect 15 ms 3692 KB Output isn't correct
37 Incorrect 1 ms 364 KB Output isn't correct
38 Incorrect 490 ms 49260 KB Output isn't correct
39 Incorrect 1 ms 364 KB Output isn't correct
40 Incorrect 57 ms 9836 KB Output isn't correct
41 Incorrect 1 ms 364 KB Output isn't correct
42 Incorrect 1 ms 748 KB Output isn't correct
43 Correct 501 ms 49388 KB Output is correct
44 Incorrect 16 ms 3692 KB Output isn't correct
45 Incorrect 502 ms 49220 KB Output isn't correct
46 Correct 501 ms 49260 KB Output is correct
47 Incorrect 499 ms 49460 KB Output isn't correct
48 Incorrect 487 ms 49260 KB Output isn't correct
49 Incorrect 511 ms 49320 KB Output isn't correct
50 Incorrect 516 ms 49260 KB Output isn't correct
51 Incorrect 502 ms 49260 KB Output isn't correct
52 Incorrect 504 ms 49260 KB Output isn't correct
53 Incorrect 500 ms 49260 KB Output isn't correct
54 Incorrect 501 ms 49260 KB Output isn't correct
55 Incorrect 499 ms 49260 KB Output isn't correct
56 Incorrect 503 ms 49388 KB Output isn't correct
57 Incorrect 503 ms 49388 KB Output isn't correct
58 Incorrect 503 ms 49260 KB Output isn't correct
59 Incorrect 504 ms 49260 KB Output isn't correct
60 Incorrect 503 ms 49388 KB Output isn't correct
61 Incorrect 499 ms 49516 KB Output isn't correct
62 Incorrect 498 ms 49504 KB Output isn't correct
63 Incorrect 496 ms 49260 KB Output isn't correct
64 Incorrect 496 ms 49260 KB Output isn't correct
65 Incorrect 502 ms 49652 KB Output isn't correct
66 Incorrect 502 ms 49260 KB Output isn't correct
67 Incorrect 495 ms 49260 KB Output isn't correct
68 Incorrect 500 ms 49388 KB Output isn't correct
69 Incorrect 498 ms 49388 KB Output isn't correct
70 Incorrect 327 ms 39432 KB Output isn't correct
71 Incorrect 497 ms 49260 KB Output isn't correct
72 Incorrect 501 ms 49260 KB Output isn't correct
73 Incorrect 504 ms 49400 KB Output isn't correct
74 Incorrect 501 ms 49388 KB Output isn't correct
75 Incorrect 500 ms 49260 KB Output isn't correct
76 Incorrect 502 ms 49388 KB Output isn't correct
77 Incorrect 501 ms 49340 KB Output isn't correct
78 Incorrect 499 ms 49260 KB Output isn't correct
79 Incorrect 503 ms 49260 KB Output isn't correct
80 Incorrect 497 ms 49388 KB Output isn't correct
81 Incorrect 503 ms 49260 KB Output isn't correct
82 Incorrect 498 ms 49260 KB Output isn't correct
83 Incorrect 496 ms 49388 KB Output isn't correct
84 Incorrect 498 ms 49532 KB Output isn't correct
85 Incorrect 504 ms 49260 KB Output isn't correct
86 Incorrect 497 ms 49260 KB Output isn't correct
87 Incorrect 508 ms 49260 KB Output isn't correct
88 Incorrect 503 ms 49260 KB Output isn't correct
89 Incorrect 498 ms 49260 KB Output isn't correct
90 Incorrect 325 ms 39532 KB Output isn't correct
91 Incorrect 499 ms 49260 KB Output isn't correct
92 Incorrect 504 ms 49252 KB Output isn't correct
93 Incorrect 502 ms 49388 KB Output isn't correct
94 Incorrect 500 ms 49264 KB Output isn't correct
95 Incorrect 497 ms 49388 KB Output isn't correct
96 Incorrect 501 ms 49252 KB Output isn't correct
97 Incorrect 497 ms 49260 KB Output isn't correct
98 Incorrect 511 ms 49388 KB Output isn't correct
99 Incorrect 498 ms 49388 KB Output isn't correct
100 Incorrect 500 ms 49260 KB Output isn't correct