#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
int convert(pair<int, int> cords, int H, int W) {
return cords.first*W + cords.second;
}
void construct_network(int H, int W, int K) {
vector<pair<int, int>> prs;
int i = 0, j=0;
// for (int i=0; i<H; i++) {
// for (int j = 0; j<W; j++) {
for (int k = max(0, i-K); k<min(H, i+K); k++) {
for (int l = max(0, j-K); l<min(W, j+K); l++) {
if (abs(i-k) + abs(j-l) == K) {
prs.push_back({min(convert({k,l}, H, W), convert({i,j}, H, W)), max(convert({k,l}, H, W), convert({i,j}, H, W))});
}
}
}
// }
// }
sort(prs.begin(), prs.end());
prs.erase(unique(prs.begin(), prs.end()), prs.end());
vector<int> blub;
for (int i= 0; i<prs.size(); i++) {
blub.push_back(add_and(vector<int>{prs[i].first, prs[i].second}));
}
add_or(blub);
}
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
33 | for (int i= 0; i<prs.size(); i++) {
| ~^~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |