# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427271 | model_code | Robot Race (CPSPC17_race) | C++98 | 3070 ms | 6164 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 <cassert>
#include <iostream>
#include <queue>
#include <string>
#include <utility>
using namespace std;
const int MAXN = 1000;
const int dr[2] = { 0, 1 };
const int dc[2] = { 1, 0 };
int n, m, q;
bool empty[MAXN][MAXN];
int age[MAXN][MAXN];
int now;
bool path_exists(int sr, int sc, int tr, int tc) {
if (sr == tr && sc == tc) return true;
now++;
queue<pair<int, int>> q;
q.emplace(sr, sc);
age[sr][sc] = now;
while (!q.empty()) {
int r = q.front().first;
int c = q.front().second;
q.pop();
if (r == tr && c == tc) break;
for (int i = 0; i < 2; i++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |