#include<bits/stdc++.h>
using namespace std;
#include "vision.h"
typedef int ll;
void construct_network(int H, int W, int K) {
vector<ll> ia, da;
for(int i=0; i<W; i++)
{
vector<ll> temp;
for(int j=0; j<=min(i,H-1); j++)
temp.push_back((i-j)+(W*j));
ia.push_back(add_or(temp));
}
for(int i=1; i<H; i++)
{
vector<ll> temp;
for(int j=0; j<W; j++)
if(j+i<H)
temp.push_back((W-j-1)+(W*(j+i)));
ia.push_back(add_or(temp));
}
for(int i=W-1; i>-1; i--)
{
vector<ll> temp;
for(int j=0; j<=min(H-1,W-i-1); j++)
{
temp.push_back((i+j)+(W*j));
}
da.push_back(add_or(temp));
}
for(int i=1; i<H; i++)
{
vector<ll> temp;
for(int j=0; j+i<W; j++)
if(j+i<H)
temp.push_back(j+(W*(j+i)));
da.push_back(add_or(temp));
}
vector<ll> asd1;
for(int i=0; i<ia.size()-K; i++)
{
vector<int> sub_vector(ia.begin() + i, ia.begin() + i+K+1);
ll a=add_xor(sub_vector);
ll b=add_not(a);
ll c=add_or(sub_vector);
asd1.push_back(add_and({b,c}));
}
vector<ll> asd2;
for(int i=0; i<da.size()-K; i++)
{
vector<int> sub_vector(da.begin() + i, da.begin() + i+K+1);
ll a=add_xor(sub_vector);
ll b=add_not(a);
ll c=add_or(sub_vector);
asd2.push_back(add_and({b,c}));
}
ll bsk_1=add_and({add_or(asd1),add_or(asd2)});
asd1.clear();
for(int i=0; i<ia.size()-K+1; i++)
{
vector<int> sub_vector(ia.begin() + i, ia.begin() + i+K);
ll a=add_xor(sub_vector);
ll b=add_not(a);
ll c=add_or(sub_vector);
asd1.push_back(add_and({b,c}));
}
asd2.clear();
for(int i=0; i<da.size()-K+1; i++)
{
vector<int> sub_vector(da.begin() + i, da.begin() + i+K);
ll a=add_xor(sub_vector);
ll b=add_not(a);
ll c=add_or(sub_vector);
asd2.push_back(add_and({b,c}));
}
ll bsk_2=add_and({add_or(asd1),add_or(asd2)});
ll ans=add_and({bsk_1,add_not(bsk_2)});
}
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:41:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
41 | for(int i=0; i<ia.size()-K; i++)
| ~^~~~~~~~~~~~
vision.cpp:50:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
50 | for(int i=0; i<da.size()-K; i++)
| ~^~~~~~~~~~~~
vision.cpp:60:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
60 | for(int i=0; i<ia.size()-K+1; i++)
| ~^~~~~~~~~~~~~~
vision.cpp:69:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
69 | for(int i=0; i<da.size()-K+1; i++)
| ~^~~~~~~~~~~~~~
vision.cpp:78:5: warning: unused variable 'ans' [-Wunused-variable]
78 | ll ans=add_and({bsk_1,add_not(bsk_2)});
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
860 KB |
Output is correct |
2 |
Correct |
5 ms |
1116 KB |
Output is correct |
3 |
Correct |
6 ms |
1112 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Incorrect |
0 ms |
348 KB |
WA in grader: Instruction with no inputs |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (1, 1), expected 1, but computed 0 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
1752 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
1 ms |
344 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |