# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1127626 | ALTAKEXE | Robots (APIO13_robots) | C++17 | 70 ms | 109384 KiB |
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int INF = 1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
vector<string> s(500);
vector<pair<int, int>> ind(10);
vector<vector<vector<int>>> dp(10, vector<vector<int>>(10, vector<int>(500 * 500, INF)));
bool ok(int x, int y, int w, int h)
{
return x >= 0 && x < h && y >= 0 && y < w && s[x][y] != 'x';
}
vector<vector<int>> BFS(int w, int h)
{
vector<vector<int>> d(w * h, vector<int>(w * h, INF));
for (int i = 0; i < w * h; i++)
{
int sx = i / w, sy = i % w;
if (s[sx][sy] == 'x')
continue;
queue<pair<int, int>> q;
q.push({sx, sy});
d[i][i] = 0;
while (!q.empty())
{
auto [x, y] = q.front();
q.pop();
int t = x * w + y;
for (int k = 0; k < 4; k++)
# | 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... |