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 "vision.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN=403;
int h, w, x, n;
vector<int> aux[2][MAXN];
int v[2][MAXN];
int final, final2;
int testa(int t) {
vector<int> blocos[2];
for(int i=t-1; i<n; i++) {
aux[0][0].clear();
aux[1][0].clear();
for(int j=i-(t-1); j<=i; j++) {
aux[0][0].push_back(v[0][j]);
aux[1][0].push_back(v[1][j]);
}
blocos[0].push_back({add_xor({add_or(aux[0][0]), add_xor(aux[0][0])})});
blocos[1].push_back({add_xor({add_or(aux[1][0]), add_xor(aux[1][0])})});
}
int aa, bb;
aa=add_or(blocos[0]);
bb=add_or(blocos[1]);
aux[0][0].clear(); for(int i=0; i<n; i++) aux[0][0].push_back(v[0][i]);
aux[1][0].clear(); for(int i=0; i<n; i++) aux[1][0].push_back(v[1][i]);
aa=add_or({aa, add_xor(aux[0][0])});
bb=add_or({bb, add_xor(aux[1][0])});
return add_and({aa, bb});
}
void construct_network(int H, int W, int K) {
h=H; w=W; x=K;
n=h+w-1;
for(int i=0; i<h; i++) {
for(int j=0; j<w; j++) {
int tipo=i+j;
int tipo2=i+(w-j-1);
int cur=i*w+j;
aux[0][tipo].push_back(cur);
aux[1][tipo2].push_back(cur);
}
}
//constroi as diagonais
for(int i=0; i<h+w-1; i++) {
v[0][i]=add_or(aux[0][i]);
v[1][i]=add_or(aux[1][i]);
}
add_xor({testa(x), testa(x+1)});
}
# | 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... |