# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
492200 | Evang | Mecho (IOI09_mecho) | C++17 | 454 ms | 6452 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 namespace std;
#define ff first
#define ss second
using pi = pair<int, int>;
using vpi = vector<pi>;
const int N = 805;
int n, s, b[N][N], m[N][N];
int dr[] = {0, 0, -1, 1};
int dc[] = {-1, 1, 0, 0};
char a[N][N]; // the grid
pi st; // the starting position for mecho
vpi h; // locations of all of the bee hives
bool good(int r, int c){ // is cell (r, c) within bounds?
return 0 <= r && r < n && 0 <= c && c < n;
}
bool ok(int t){ // can the answer be t?
memset(b, -1, sizeof b);
memset(m, -1, sizeof m);
queue<pi> q; // all of the current bees' possible locations
for(auto x: h){
q.push(x);
b[x.ff][x.ss] = 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |