Submission #264730

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2647302020-08-14 08:37:31WLZMecho (IOI09_mecho)C++17
100 / 100
945 ms6408 KiB
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const vector<int> dx = {0, 0, -1, 1};
const vector<int> dy = {1, -1, 0, 0};
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, s;
cin >> n >> s;
vector<string> grid(n);
queue< pair<int, int> > q;
vector< vector<int> > dist1(n, vector<int>(n, -1));
int mr, mc, dr, dc;
for (int i = 0; i < n; i++) {
cin >> grid[i];
for (int j = 0; j < n; j++) {
if (grid[i][j] == 'M') {
mr = i; mc = j;
} else if (grid[i][j] == 'H') {
q.push({i, j});
dist1[i][j] = 0;
} else if (grid[i][j] == 'D') {
dr = i; dc = j;
}
}
}
while (!q.empty()) {
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

mecho.cpp: In function 'int main()':
mecho.cpp:47:17: warning: 'mc' may be used uninitialized in this function [-Wmaybe-uninitialized]
   47 |     dist2[mr][mc] = s * mid;
      |                 ^
mecho.cpp:47:13: warning: 'mr' may be used uninitialized in this function [-Wmaybe-uninitialized]
   47 |     dist2[mr][mc] = s * mid;
      |             ^
mecho.cpp:66:21: warning: 'dc' may be used uninitialized in this function [-Wmaybe-uninitialized]
   66 |     if (dist2[dr][dc] < INF) {
      |                     ^
mecho.cpp:66:17: warning: 'dr' may be used uninitialized in this function [-Wmaybe-uninitialized]
   66 |     if (dist2[dr][dc] < INF) {
      |                 ^
#Verdict Execution timeMemoryGrader output
Fetching results...