# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1021526 | vjudge1 | Vision Program (IOI19_vision) | C++17 | 2 ms | 984 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 "vision.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector <ll>;
using vi = vector <int>;
void construct_network (int h, int w, int k) {
vi th;
auto toLine = [&](ll i, ll j) { return 0 <= i && i < h && 0 <= j && j < w ? i*w+j : -16; };
auto getNeigh = [&](ll i, ll j) -> vi {
vi ans;
if (toLine(i-1, j) != -16) ans.push_back(toLine(i-1, j));
if (toLine(i+1, j) != -16) ans.push_back(toLine(i+1, j));
if (toLine(i, j-1) != -16) ans.push_back(toLine(i, j-1));
if (toLine(i, j+1) != -16) ans.push_back(toLine(i, j+1));
return ans;
};
for (ll i = 0; i < h; i++) {
for (ll j = 0; j < w; j++) {
th.push_back(add_and({ toLine(i, j), add_or({ getNeigh(i, j) }) }));
}
}
add_or(th);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |