This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
Vision Program
*/
#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
int height, width;
int arrayPos(int c, int r)
{
return c * width + r;
}
bool inside(int c, int r)
{
return c >= 0 && c < height && r >= 0 && r < width;
}
void construct_network(int H, int W, int K)
{
height = H; width = W;
vector<int> instructions;
vector<int> Ns;
for (int j = 0; j <= K; j++)
{
if (inside(j, (K - j)))
Ns.push_back(arrayPos(j, (K - j)));
}
int i = add_or(Ns);
instructions.push_back({add_and({0, i})});
add_or(instructions);
}
/*
--Sample testcase--
vector<int> Ns;
Ns = {0, 5};
int a = add_and(Ns);
Ns = {3, 2};
int b = add_and(Ns);
Ns = {a, b};
add_or(Ns);
---
2 3 1
0 0
1 2
-1
*/
# | 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... |