# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
749391 | __Davit__ | Dijamant (COCI22_dijamant) | C++17 | 1 ms | 1108 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>
using namespace std;
int n, m;
vector<vector<char>> maze;
vector<vector<int>> col;
int id = 1;
vector<int> dx = {1, 0, 0, -1, 1, 1, -1, -1};
vector<int> dy = {0, 1, -1, 0, 1, -1, 1, -1};
vector<pair<int, int>> coords;
bool valid(int x, int y) {
if (x < 0 || x > n - 1 || y < 0 || y > m - 1) {
return false;
}
if (maze[x][y] == '#')return false;
if (col[x][y])return false;
return true;
}
void dfs(int x, int y) {
col[x][y] = id;
coords.push_back({x, y});
for (int i = 0; i < 4; i++) {
if (valid(x + dx[i], y + dy[i])) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |