Submission #466003

# Submission time Handle Problem Language Result Execution time Memory
466003 2021-08-17T13:38:27 Z Sench2006 Game (eJOI20_game) C++14
0 / 100
1 ms 204 KB
#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 time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -