# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
518453 | Alex_tz307 | Mecho (IOI09_mecho) | C++17 | 171 ms | 6856 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>
#define INF 0x3f3f3f3f
using namespace std;
void testCase() {
int n, s;
cin >> n >> s;
vector<string> a(n + 1);
queue<pair<int, int>> q;
vector<vector<int>> bee(n + 1, vector<int>(n + 1, INF));
int istart = -1, jstart = -1, istop = -1, jstop = -1;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
a[i] = '$' + a[i];
for (int j = 1; j <= n; ++j) {
if (a[i][j] == 'H') {
bee[i][j] = 0;
q.emplace(i, j);
} else if (a[i][j] == 'M') {
istart = i, jstart = j;
} else if (a[i][j] == 'D') {
istop = i, jstop = j;
}
}
}
const int di[] = {-1, 0, 1, 0}, dj[] = {0, 1, 0, -1};
auto valid = [&](const int &i, const int &j) -> bool {
return 1 <= min(i, j) && max(i, j) <= n && a[i][j] != 'T';
};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |