Submission #475246

#TimeUsernameProblemLanguageResultExecution timeMemory
475246Beboo44Selotejp (COCI20_selotejp)C++14
0 / 110
0 ms204 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define fast_io ios_base::sync_with_stdio(0); cin.tie(0) int main() { ios_base::sync_with_stdio(0) ; cin.tie(0) ; ll n,m; cin>>n>>m; vector<vector<char>> v(n,vector<char>(m)); for(int i=0; i<n; ++i){ for(int j=0;j<m; ++j){ cin>>v[i][j]; } } ll sum=1e18; ll last =-1; ll ans=0; for(int i=0; i<n; ++i){ for(int j=0; j<m; ++j){ if(v[i][j]=='#' && last==-1){ ++ans; last=1; } else{ last=-1; } } sum = min(sum,ans); } for(int j=0; j<m; ++j){ for(int i=0; i<n; ++i){ if(v[i][j]=='#' && last==-1){ ++ans; last=1; } else{ last=-1; } } sum = min(sum,ans); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...