# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
501515 | aryan12 | Vision Program (IOI19_vision) | C++17 | 11 ms | 2244 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;
//expected to work for subtasks: 1, 2, 3, 5
void construct_network(int H, int W, int K) {
int cnt = 0;
for(int i = 0; i < H; i++) {
for(int j = 0; j < W; j++) {
//to check if this has a black cell;
//to check if every kth distance has a black cell or not
//will only check between 90 and 180 degrees (inclusive)
vector<int> temp;
for(int newr = K; newr >= 0; newr--) {
int newc = K - newr;
int r = i + newr, c = j + newc;
if(0 <= r && r < H && 0 <= c && c < W) {
temp.push_back(r * W + c);
}
c = j - newc;
if(0 <= r && r < H && 0 <= c && c < W) {
temp.push_back(r * W + c);
}
}
if(temp.size() != 0) {
int res1 = add_and({i * W + j});
int res2 = add_or(temp);
cnt += 2;
}
}
}
int cnt2 = 0;
for(int i = 0; i < cnt; i += 2) {
add_and({H * W + i, H * W + i + 1});
cnt2++;
}
vector<int> finalans;
for(int i = cnt; i < cnt + cnt2; i++) {
finalans.push_back(H * W + i);
}
int x = add_or(finalans);
/*std::vector<int> Ns;
Ns = {0, 1};
int a = add_and(Ns);
Ns = {0, a};
int b = add_or(Ns);
Ns = {0, 1, b};
int c = add_xor(Ns);
add_not(c);*/
}
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... |