This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define pb push_back
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int32_t main(){
int n,m;
cin>>n>>m;
int a[n+1][m],b[n][m+1];
for(int i=0;i<=n;i++){
for(int j=0;j<m;j++){
char c;
cin>>c;
a[i][j]=c-'0';
}
}
for(int i=0;i<n;i++){
for(int j=0;j<=m;j++){
char c;
cin>>c;
b[i][j]=c-'0';
}
}
int cnt=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
int x=a[i][j]+a[i+1][j]+b[i][j]+b[i][j+1];
cnt+=(x==2);
}
}
cout<<-cnt<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |