# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
299078 | Bruteforceman | Coins (LMIO19_monetos) | C++11 | 2089 ms | 2620 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;
const int maxn = 305 + 10;
int a[maxn][maxn], b[maxn][maxn];
int d[maxn][maxn];
pair <int, int> par[maxn][maxn];
int n;
bool inside(int x, int y) {
return (0 <= x && x < n) && (0 <= y && y < n);
}
bool check(int x, int y) {
if(not inside(x, y)) return false;
if(inside(x + 1, y) && b[x + 1][y] == 0) return false;
if(inside(x, y + 1) && b[x][y + 1] == 0) return false;
return true;
}
pair <int, int> getOpt(vector <pair <int, int>> can) {
queue <pair <int, int>> Q;
for(auto i : can) {
Q.push(i);
d[i.first][i.second] = 0;
par[i.first][i.second] = i;
}
vector <pair <int, int>> filled;
pair <int, int> ret (-1, -1);
pair <int, int> from (-1, -1);
bool found = false;
while(not Q.empty()) {
int x = Q.front().first;
int y = Q.front().second;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |