Submission #833221

#TimeUsernameProblemLanguageResultExecution timeMemory
833221vjudge1Bomb (IZhO17_bomb)C++17
14 / 100
130 ms19788 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, k; string s[2500]; vector<int> v; void check_hor(){ for(int j=1; j<=n; j++){ k=0; for(int i=0; i<=m; i++){ if(i<m && s[j][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 check_ver(){ for(int j=0; j<m; j++){ k=0; for(int i=1; i<=n+1; i++){ if(i<=n && s[i][j]=='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]; } check_hor(); v.clear(); check_ver(); cout << ver*hor << endl; return 0; }

Compilation message (stderr)

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