Submission #915557

# Submission time Handle Problem Language Result Execution time Memory
915557 2024-01-24T07:11:23 Z vjudge1 Bomb (IZhO17_bomb) C++17
12 / 100
38 ms 31832 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 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;
                    }
                }
                
            }
        }
        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:20:13: warning: unused variable 'o' [-Wunused-variable]
   20 |         int o=0;
      |             ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 1 ms 600 KB Output isn't correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Correct 0 ms 348 KB Output is correct
8 Incorrect 0 ms 348 KB Output isn't correct
9 Incorrect 0 ms 348 KB Output isn't correct
10 Incorrect 0 ms 348 KB Output isn't correct
11 Incorrect 1 ms 600 KB Output isn't correct
12 Incorrect 0 ms 348 KB Output isn't correct
13 Incorrect 0 ms 348 KB Output isn't correct
14 Correct 0 ms 348 KB Output is correct
15 Incorrect 0 ms 348 KB Output isn't correct
16 Incorrect 0 ms 348 KB Output isn't correct
17 Correct 0 ms 348 KB Output is correct
18 Incorrect 0 ms 348 KB Output isn't correct
19 Incorrect 0 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 1 ms 348 KB Output isn't correct
24 Incorrect 0 ms 348 KB Output isn't correct
25 Incorrect 1 ms 344 KB Output isn't correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 860 KB Output is correct
28 Incorrect 1 ms 860 KB Output isn't correct
29 Incorrect 1 ms 860 KB Output isn't correct
30 Incorrect 1 ms 1372 KB Output isn't correct
31 Incorrect 1 ms 1116 KB Output isn't correct
32 Incorrect 1 ms 1116 KB Output isn't correct
33 Incorrect 1 ms 1264 KB Output isn't correct
34 Incorrect 1 ms 860 KB Output isn't correct
35 Incorrect 1 ms 1372 KB Output isn't correct
36 Incorrect 1 ms 1372 KB Output isn't correct
37 Incorrect 0 ms 348 KB Output isn't correct
38 Incorrect 30 ms 31664 KB Output isn't correct
39 Incorrect 0 ms 348 KB Output isn't correct
40 Incorrect 3 ms 4188 KB Output isn't correct
41 Incorrect 0 ms 348 KB Output isn't correct
42 Incorrect 1 ms 344 KB Output isn't correct
43 Correct 32 ms 31572 KB Output is correct
44 Incorrect 1 ms 1372 KB Output isn't correct
45 Incorrect 32 ms 31680 KB Output isn't correct
46 Correct 31 ms 31572 KB Output is correct
47 Incorrect 31 ms 31580 KB Output isn't correct
48 Incorrect 31 ms 31580 KB Output isn't correct
49 Correct 31 ms 31580 KB Output is correct
50 Incorrect 32 ms 31496 KB Output isn't correct
51 Incorrect 32 ms 31572 KB Output isn't correct
52 Incorrect 34 ms 31572 KB Output isn't correct
53 Incorrect 31 ms 31532 KB Output isn't correct
54 Incorrect 31 ms 31580 KB Output isn't correct
55 Incorrect 33 ms 31560 KB Output isn't correct
56 Incorrect 31 ms 31580 KB Output isn't correct
57 Incorrect 32 ms 31468 KB Output isn't correct
58 Incorrect 31 ms 31568 KB Output isn't correct
59 Incorrect 32 ms 31568 KB Output isn't correct
60 Correct 32 ms 31572 KB Output is correct
61 Incorrect 35 ms 31828 KB Output isn't correct
62 Correct 29 ms 31580 KB Output is correct
63 Correct 29 ms 31492 KB Output is correct
64 Correct 31 ms 31580 KB Output is correct
65 Incorrect 32 ms 31496 KB Output isn't correct
66 Incorrect 31 ms 31568 KB Output isn't correct
67 Incorrect 30 ms 31576 KB Output isn't correct
68 Incorrect 29 ms 31568 KB Output isn't correct
69 Incorrect 33 ms 31568 KB Output isn't correct
70 Incorrect 21 ms 20312 KB Output isn't correct
71 Incorrect 32 ms 31580 KB Output isn't correct
72 Incorrect 31 ms 31580 KB Output isn't correct
73 Incorrect 32 ms 31580 KB Output isn't correct
74 Incorrect 32 ms 31580 KB Output isn't correct
75 Incorrect 31 ms 31580 KB Output isn't correct
76 Incorrect 34 ms 31568 KB Output isn't correct
77 Incorrect 31 ms 31580 KB Output isn't correct
78 Incorrect 32 ms 31588 KB Output isn't correct
79 Incorrect 32 ms 31488 KB Output isn't correct
80 Incorrect 32 ms 31580 KB Output isn't correct
81 Incorrect 31 ms 31832 KB Output isn't correct
82 Incorrect 31 ms 31572 KB Output isn't correct
83 Incorrect 32 ms 31580 KB Output isn't correct
84 Incorrect 33 ms 31580 KB Output isn't correct
85 Incorrect 34 ms 31624 KB Output isn't correct
86 Incorrect 29 ms 31580 KB Output isn't correct
87 Incorrect 30 ms 31580 KB Output isn't correct
88 Incorrect 35 ms 31580 KB Output isn't correct
89 Incorrect 32 ms 31580 KB Output isn't correct
90 Incorrect 20 ms 20312 KB Output isn't correct
91 Incorrect 38 ms 31572 KB Output isn't correct
92 Incorrect 31 ms 31580 KB Output isn't correct
93 Incorrect 29 ms 31580 KB Output isn't correct
94 Incorrect 32 ms 31576 KB Output isn't correct
95 Incorrect 35 ms 31576 KB Output isn't correct
96 Incorrect 31 ms 31580 KB Output isn't correct
97 Incorrect 30 ms 31580 KB Output isn't correct
98 Incorrect 31 ms 31528 KB Output isn't correct
99 Incorrect 32 ms 31568 KB Output isn't correct
100 Incorrect 31 ms 31572 KB Output isn't correct