#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
int ans(int H, int W, int K)
{
vector<int>V;
vector<int> Dr[405],Dl[405],cur,p,b,x;
int diag[405],dia[450];
for(int i=0;i<H;i++)
for(int j=0;j<W;j++)
{
Dr[i-j+W-1].push_back(i*W+j);
Dl[i+j].push_back(i*W+j);
}
for(int i=W+H-2;i>=0;i--)
{
cur.clear();
cur.push_back(add_or(Dr[i]));
p.clear();
p.push_back(diag[i+1]);
diag[i]=add_and({add_or(cur),add_or(p)});
if(i+K<=W+H-2)
{
p.clear();
p.push_back(diag[i+K]);
p.push_back(add_or(cur));
b.push_back(add_and(p));
}
if(i+K<=W+H-3)
{
p.clear();
p.push_back(diag[i+K+1]);
p.push_back(add_and(cur));
b.push_back((add_and(p)));
}
V.push_back(add_xor(b));
}
for(int i=0;i<=W+H-2;i++)
{
cur.clear();
cur.push_back(add_or(Dl[i]));
p.clear();
p.push_back(dia[i+1]);
dia[i]=add_and({add_or(cur),add_or(p)});
if(i-K>=0)
{
p.clear();
p.push_back(dia[i-K]);
b.push_back(add_and({diag[i-K],add_or(cur)}));
}
if(i-K>=1)
{
p.clear();
p.push_back(diag[i-K-1]);
p.push_back(add_and(cur));
b.push_back(add_and(p));
}
V.push_back(add_xor(b));
}
return add_or(V);
}
void construct_network(int H, int W, int K){
ans(H,W,K);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
760 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |