Submission #833216

#TimeUsernameProblemLanguageResultExecution timeMemory
833216vjudge1Bomb (IZhO17_bomb)C++17
5 / 100
125 ms19840 KiB
#include <bits/stdc++.h> #define ll long long #define fi first #define se second #define pb push_back #define pll pair<ll, ll> using namespace std; int m, n, ans, ver, hor; string s[2500]; vector<int> v; void sub1a(){ int k=0; for(int i=0; i<=m; i++){ if(i<m && s[1][i]=='1') k++; else{ if(k>0) v.pb(k); k=0; } } sort(v.begin(), v.end()); if(v.size()>0) hor=v[0]; } void sub1b(){ ans=1e5; int k=0; for(int i=1; i<=n+1; i++){ if(i<=n && s[i][0]=='1') k++; else{ if(k>0) v.pb(k); k=0; } } sort(v.begin(), v.end()); if(v.size()>0) ver=v[0]; } int main(){ cin >> n >> m; for(int i=1; i<=n; i++){ cin >> s[i]; } sub1a(); sub1b(); cout << ver*hor << endl; return 0; }

Compilation message (stderr)

bomb.cpp: In function 'void sub1a()':
bomb.cpp:17:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   17 |    if(k>0) v.pb(k); k=0;
      |    ^~
bomb.cpp:17:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   17 |    if(k>0) v.pb(k); k=0;
      |                     ^
bomb.cpp: In function 'void sub1b()':
bomb.cpp:30:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   30 |    if(k>0) v.pb(k); k=0;
      |    ^~
bomb.cpp:30:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   30 |    if(k>0) v.pb(k); k=0;
      |                     ^
#Verdict Execution timeMemoryGrader output
Fetching results...