# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1003560 | julian | Dijamant (COCI22_dijamant) | C++98 | 1 ms | 1116 KiB |
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 a, b, c, d, cnt;
long mini, minj, maxi, maxj;
void dfs(long i, long j, std::vector<std::vector<bool>>& map) {
if (!map[i][j]) return;
a = std::min(a, i + j);
b = std::max(b, i + j);
c = std::min(c, i - j);
d = std::max(d, i - j);
mini = std::min(mini, i);
maxi = std::max(maxi, i);
minj = std::min(minj, j);
maxj = std::max(maxj, j);
map[i][j] = false;
cnt++;
if (i > 0) dfs(i - 1, j, map);
if (i < map.size() - 1) dfs(i + 1, j, map);
if (j > 0) dfs(i, j - 1, map);
if (j < map.size() - 1) dfs(i, j + 1, map);
}
int main() {
long n, m;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |