Submission #466003

#TimeUsernameProblemLanguageResultExecution timeMemory
466003Sench2006Game (eJOI20_game)C++14
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define lb lower_bound #define ub upper_bound #define FOR(i, a, b) for(auto i = a; i < b; i++) #define FORD(i, a, b) for(auto i = a - 1; i >= b; i--) #define trav(x, v) for(auto x : v) #define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // ---------------------------------------- Solution ---------------------------------------- // const int N = 25; int n, m, ans; int a[N][N]; int b[N][N]; void solve() { cin >> n >> m; FOR(i, 0, n + 1) { FOR(j, 0, m) { cin >> a[i][j]; } } FOR(i, 0, n) { FOR(j, 0, m + 1) { cin >> b[i][j]; } } FOR(i, 0, n) { FOR(j, 0, m) { if (a[i][j] && a[i + 1][j] && b[i][j] && b[i][j + 1]) ans++; } } cout << -(n * m - ans) << "\n"; } int main() { fastio; int tests = 1; // cin >> tests; while (tests--) { solve(); } return 0; }
#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...