# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1143649 | Rufat | Mecho (IOI09_mecho) | C++20 | 1092 ms | 17040 KiB |
#include <bits/stdc++.h>
using namespace std;
// A large number used as “infinity”
const int INF = 1000000000;
// Global direction arrays for 4‐way movement.
int dr[4] = {1, -1, 0, 0};
int dc[4] = {0, 0, 1, -1};
// Main
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, S;
cin >> N >> S;
vector<string> grid(N);
for (int i = 0; i < N; i++){
cin >> grid[i];
}
pair<int,int> start, dest;
vector<pair<int,int>> hives;
// Scan the grid for special cells.
for (int i = 0; i < N; i++){
for (int j = 0; j < N; j++){
char c = grid[i][j];
if(c=='M'){
start = {i,j};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |