Submission #464913

#TimeUsernameProblemLanguageResultExecution timeMemory
464913bigoGame (eJOI20_game)C++14
20 / 100
1 ms292 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<int, int> pii; #define le first.first #define ri first.second #define dw second.first #define up second.second int main() { int n, m; cin >> n >> m; vector<vector<int>>hez((n + 1), vector<int>(m)), ver((n), vector<int>(m+1)); string a; for (int i = 0; i <= n; i++) { cin >> a; for (int j = 0; j < m; j++) { if (a[j] == '1') hez[i][j] = 1; else hez[i][j] = 0; } } for (int i = 0; i < n; i++) { cin >> a; for (int j = 0; j <= m; j++) { if (a[j] == '1') ver[i][j] = 1; else ver[i][j] = 0; } } vector<pair<pii, pii>>vec(n*m); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { vec[i * m + j].le = ver[i][j]; vec[i * m + j].ri = ver[i][j + 1]; vec[i * m + j].up = hez[i][j]; vec[i * m + j].dw = hez[i + 1][j]; } } int ans = -n * m; for (int i = 0; i < n * m; i++) { if (vec[i].le == 1 and vec[i].ri == 1 and vec[i].up == 1 and vec[i].dw == 1) ans++; } cout << ans; }
#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...