#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include "vision.h"
using namespace std;
void construct_network(int h, int w, int k){
vector<int> left[500], right[500];
for (int i = 0; i < h; i++){
for (int j = 0; j < w; j++){
left[i + j].push_back(i*w + j);
right[j - i + h - 1].push_back(i*w + j);
}
}
int l1[500], l2[500], r1[500], r2[500];
for (int i = 0; i < h + w - 1; i++){
l1[i] = add_or(left[i]);
r1[i] = add_or(right[i]);
l2[i] = add_xor({add_xor(left[i]), add_or(left[i])});
r2[i] = add_xor({add_xor(right[i]), add_or(right[i])});
}
vector<int> l, r;
for (int i = 0; i + k < h + w - 1; i++){
vector<int> twos, ones;
for (int j = i; j < i + k; j++){
twos.push_back(l2[j]);
ones.push_back(l1[j]);
}
twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
l.push_back(add_or(twos));
}
for (int i = 0; i + k < h + w; i++){
vector<int> twos, ones;
for (int j = i; j < i + k; j++){
twos.push_back(r2[j]);
ones.push_back(r1[j]);
}
twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
r.push_back(add_or(twos));
}
k--;
int moze_kplusjedan = add_and({add_or(l), add_or(r)});
l.clear(); r.clear();
for (int i = 0; i + k < h + w - 1; i++){
vector<int> twos, ones;
for (int j = i; j < i + k; j++){
twos.push_back(l2[j]);
ones.push_back(l1[j]);
}
twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
l.push_back(add_or(twos));
}
for (int i = 0; i + k < h + w - 1; i++){
vector<int> twos, ones;
for (int j = i; j < i + k; j++){
twos.push_back(r2[j]);
ones.push_back(r1[j]);
}
twos.push_back(add_xor({add_xor(ones), add_or(ones)}));
r.push_back(add_or(twos));
}
int moze_k = add_and({add_or(l), add_or(r)});
int rj = add_and({moze_kplusjedan, add_not(moze_k)});
return;
}
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:71:9: warning: unused variable 'rj' [-Wunused-variable]
71 | int rj = add_and({moze_kplusjedan, add_not(moze_k)});
| ^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
640 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
288 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
2176 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |