# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
482932 | PacifiedPenguin | Mecho (IOI09_mecho) | C++17 | 381 ms | 6852 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 P = std::pair<int, int>;
const int INF = 1e9;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int32_t main() {
std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
int N, S; std::cin >> N >> S;
std::vector<std::string> a(N);
P start, end;
std::vector<std::vector<int>> dpB(N, std::vector<int>(N, INF));
std::queue<P> qb;
for(int i = 0; i < N; i++){
std::cin >> a[i];
for(int j = 0; j < N; j++){
if(a[i][j] == 'M'){
start = P(i, j);
a[i][j] = 'G';
}else if(a[i][j] == 'D'){
end = P(i, j);
}else if(a[i][j] == 'H'){
qb.emplace(i, j);
dpB[i][j] = 0;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |