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>
using namespace std;
void solve_subtask_1_questionmark() {
int n, m;
cin >> n >> m;
int cnt = 0;
bool edge = false;
for(int i = 0; i <= n; ++i) {
for(int j = 0; j < m; ++j) {
char ch;
cin >> ch;
if(ch == '0') {
++cnt;
if(i == 0) {
edge = true;
}
}
}
}
for(int i = 0; i <= m; ++i) {
for(int j = 0; j < n; ++j) {
char ch;
cin >> ch;
if(ch == '0') {
++cnt;
if(i == 0) {
edge = true;
}
}
}
}
if(edge) {
cnt += 2;
}
cout << -(cnt/2-1) << "\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve_subtask_1_questionmark();
return 0;
}
# | 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... |