Submission #915559

# Submission time Handle Problem Language Result Execution time Memory
915559 2024-01-24T07:14:45 Z vjudge1 Bomb (IZhO17_bomb) C++17
24 / 100
53 ms 56408 KB
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
#include <bits/stdc++.h>
#include <vector>
#define int long long 
#define pb push_back
#define str string
using namespace std;

int pp[3001];

void solve(){
    int n,m;
    cin>>n>>m;
    if(n<=3000 && m<=3000){
        str s[n+3];
        int a[n+3][m+3];
        int o=0;
        int ss=1000000,b=1000000;
        for(int i=1;i<=n;i++){
            cin>>s[i];
            int k=0;
            for(int j=0;j<m;j++){
                a[i][j+1]=s[i][j]-'0';
                if(a[i][j+1]==1){
                    k++;
                    pp[j+1]++;
                }
                else{
                    if(k>0){
                        ss=min(ss,k);
                        k=0;
                    }
                    if(pp[j+1]>0){
                        b=min(b,pp[j+1]);
                        pp[j+1]=0;
                    }
                }
                if(pp[j+1]>0 && i==n){
                    b=min(b,pp[j+1]);
                    pp[j+1]=0;
                }
            }
            if(k>0){
                ss=min(ss,k);
                k=0;
            }
        }
        cout<<ss*b;
        
    }
}

signed main(){
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	//srand( time(0));
	//rand()
	//freopen("sum.in", "r", stdin);
	//freopen("sum.out", "w", stdout);
    int tests=1;
    //cin>>tests;
    for(int i=1;i<=tests;i++){
		//cout<<"TEST CASE : "<<i<<"\n";
		solve();
	}
}


Compilation message

bomb.cpp:3: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    3 | #pragma GCC optimization("unroll-loops")
      | 
bomb.cpp: In function 'void solve()':
bomb.cpp:21:13: warning: unused variable 'o' [-Wunused-variable]
   21 |         int o=0;
      |             ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 0 ms 604 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Incorrect 0 ms 348 KB Output isn't correct
9 Incorrect 1 ms 348 KB Output isn't correct
10 Incorrect 0 ms 348 KB Output isn't correct
11 Incorrect 1 ms 348 KB Output isn't correct
12 Incorrect 0 ms 348 KB Output isn't correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Incorrect 0 ms 348 KB Output isn't correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Incorrect 0 ms 348 KB Output isn't correct
19 Incorrect 1 ms 348 KB Output isn't correct
20 Incorrect 0 ms 348 KB Output isn't correct
21 Incorrect 0 ms 348 KB Output isn't correct
22 Incorrect 0 ms 348 KB Output isn't correct
23 Incorrect 0 ms 348 KB Output isn't correct
24 Incorrect 0 ms 348 KB Output isn't correct
25 Incorrect 1 ms 348 KB Output isn't correct
26 Correct 1 ms 348 KB Output is correct
27 Correct 1 ms 1180 KB Output is correct
28 Incorrect 1 ms 1372 KB Output isn't correct
29 Incorrect 1 ms 1372 KB Output isn't correct
30 Incorrect 2 ms 2000 KB Output isn't correct
31 Incorrect 1 ms 1624 KB Output isn't correct
32 Incorrect 1 ms 1880 KB Output isn't correct
33 Incorrect 2 ms 2136 KB Output isn't correct
34 Incorrect 1 ms 1116 KB Output isn't correct
35 Incorrect 2 ms 2140 KB Output isn't correct
36 Correct 2 ms 2140 KB Output is correct
37 Incorrect 1 ms 348 KB Output isn't correct
38 Correct 44 ms 56148 KB Output is correct
39 Incorrect 0 ms 344 KB Output isn't correct
40 Incorrect 5 ms 7260 KB Output isn't correct
41 Incorrect 0 ms 348 KB Output isn't correct
42 Incorrect 0 ms 348 KB Output isn't correct
43 Correct 43 ms 56148 KB Output is correct
44 Incorrect 2 ms 2140 KB Output isn't correct
45 Incorrect 47 ms 56096 KB Output isn't correct
46 Correct 43 ms 56144 KB Output is correct
47 Incorrect 43 ms 56144 KB Output isn't correct
48 Incorrect 45 ms 56144 KB Output isn't correct
49 Correct 44 ms 56144 KB Output is correct
50 Incorrect 44 ms 56148 KB Output isn't correct
51 Incorrect 47 ms 56144 KB Output isn't correct
52 Incorrect 45 ms 56160 KB Output isn't correct
53 Incorrect 42 ms 56140 KB Output isn't correct
54 Incorrect 42 ms 56012 KB Output isn't correct
55 Incorrect 45 ms 56144 KB Output isn't correct
56 Correct 47 ms 56148 KB Output is correct
57 Incorrect 43 ms 56060 KB Output isn't correct
58 Incorrect 44 ms 56148 KB Output isn't correct
59 Incorrect 51 ms 56140 KB Output isn't correct
60 Correct 51 ms 55968 KB Output is correct
61 Correct 46 ms 56188 KB Output is correct
62 Correct 44 ms 56144 KB Output is correct
63 Correct 45 ms 56148 KB Output is correct
64 Correct 43 ms 56168 KB Output is correct
65 Incorrect 51 ms 56172 KB Output isn't correct
66 Incorrect 43 ms 56008 KB Output isn't correct
67 Incorrect 45 ms 56144 KB Output isn't correct
68 Incorrect 44 ms 56108 KB Output isn't correct
69 Incorrect 44 ms 56088 KB Output isn't correct
70 Incorrect 28 ms 35932 KB Output isn't correct
71 Incorrect 43 ms 56152 KB Output isn't correct
72 Incorrect 45 ms 56200 KB Output isn't correct
73 Incorrect 47 ms 56144 KB Output isn't correct
74 Incorrect 45 ms 56148 KB Output isn't correct
75 Incorrect 45 ms 56072 KB Output isn't correct
76 Incorrect 45 ms 56148 KB Output isn't correct
77 Incorrect 46 ms 56208 KB Output isn't correct
78 Incorrect 43 ms 56144 KB Output isn't correct
79 Incorrect 51 ms 56148 KB Output isn't correct
80 Incorrect 41 ms 56144 KB Output isn't correct
81 Incorrect 44 ms 56148 KB Output isn't correct
82 Incorrect 45 ms 56140 KB Output isn't correct
83 Incorrect 43 ms 56148 KB Output isn't correct
84 Incorrect 43 ms 56144 KB Output isn't correct
85 Incorrect 44 ms 55992 KB Output isn't correct
86 Incorrect 49 ms 56144 KB Output isn't correct
87 Incorrect 45 ms 56152 KB Output isn't correct
88 Incorrect 44 ms 56152 KB Output isn't correct
89 Incorrect 48 ms 56408 KB Output isn't correct
90 Incorrect 30 ms 35924 KB Output isn't correct
91 Incorrect 45 ms 56156 KB Output isn't correct
92 Incorrect 46 ms 56148 KB Output isn't correct
93 Incorrect 47 ms 56144 KB Output isn't correct
94 Incorrect 47 ms 56144 KB Output isn't correct
95 Incorrect 46 ms 56404 KB Output isn't correct
96 Incorrect 46 ms 56148 KB Output isn't correct
97 Incorrect 53 ms 56184 KB Output isn't correct
98 Incorrect 44 ms 56144 KB Output isn't correct
99 Incorrect 44 ms 56036 KB Output isn't correct
100 Incorrect 45 ms 56148 KB Output isn't correct