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<bits/stdc++.h>
#include "vision.h"
using namespace std;
typedef int ll;
void construct_network(int H, int W, int K) {
vector<vector<ll>> ia(H+W-1), da(H+W-1);
vector<ll>iaor,daor;
for(int i=0; i<H; i++){
for(int j=0; j<W; j++){
ia[i+j].push_back(i*W+j);
da[i-j+W-1].push_back(i*W+j);
}
}
for(auto i:ia) if(i.size()>0) iaor.push_back(add_or(i));
for(auto i:da) if(i.size()>0) daor.push_back(add_or(i));
vector<ll> asd1;
for(int i=0; i<iaor.size()-K; i++)
{
vector<int> sub_vector(iaor.begin() + i, iaor.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<daor.size()-K; i++)
{
vector<int> sub_vector(daor.begin() + i, daor.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<iaor.size()-K+1; i++)
{
vector<int> sub_vector(iaor.begin() + i, iaor.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<daor.size()-K+1; i++)
{
vector<int> sub_vector(daor.begin() + i, daor.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 (stderr)
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:17:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
17 | for(int i=0; i<iaor.size()-K; i++)
| ~^~~~~~~~~~~~~~
vision.cpp:26:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
26 | for(int i=0; i<daor.size()-K; i++)
| ~^~~~~~~~~~~~~~
vision.cpp:36:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
36 | for(int i=0; i<iaor.size()-K+1; i++)
| ~^~~~~~~~~~~~~~~~
vision.cpp:45:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
45 | for(int i=0; i<daor.size()-K+1; i++)
| ~^~~~~~~~~~~~~~~~
vision.cpp:54:5: warning: unused variable 'ans' [-Wunused-variable]
54 | ll ans=add_and({bsk_1,add_not(bsk_2)});
| ^~~
# | 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... |