Submission #758346

#TimeUsernameProblemLanguageResultExecution timeMemory
758346ihcekerGame (eJOI20_game)C++14
20 / 100
1 ms304 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...