# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1136235 | ALTAKEXE | Robots (APIO13_robots) | C++17 | 49 ms | 111936 KiB |
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define INF INT_MAX
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FAR(i, a, b) for (int i = (a); i >= (b); i--)
#define all(x) (x.begin(), x.end())
const int MOD = 1e9 + 7;
using namespace std;
int n, w, h;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
pair<int, int> m[500][500][4];
char s[501][501];
vector<pair<int, int>> g[500][500];
int cost[10][10][500][500];
pair<int, int> dfs(int x, int y, int d)
{
if (x < 0)
return {x + 1, y};
if (y < 0)
return {x, y + 1};
if (x >= h)
return {x - 1, y};
if (y >= w)
return {x, y - 1};
if (s[x][y] == 'x')
return {x + dx[d * d], y + dy[d * d]};
if (m[x][y][d] != pair<int, int>{-1, -1})
# | 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... |