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>
long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
std::vector<std::vector<bool>> used(m, std::vector<bool>(m, false));
for (int i = 0; i < n; ++i) {
int left = r[i], right = c[i];
if (left > right)
std::swap(left, right);
for (int x = left; x <= right; ++x) {
for (int y = left; y <= right; ++y) {
used[x][y] = true;
}
}
}
long long result = 0;
for (int x = 0; x != m; ++x) {
for (int y = 0; y != m; ++y) {
result += used[x][y];
}
}
return result;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |