# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
602844 | MeGustaElArroz23 | Vision Program (IOI19_vision) | C++14 | 51 ms | 2900 KiB |
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;
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
void construct_network(int H, int W, int K) {
//W width H height
//diagonales |_
//distancia K
vi diagonales;
for (int i=0;i<H+W-1;i++){
vi acdiagonal(0);
for (int h=0;h<H;h++){
if (i-h<W && i-h>=0) acdiagonal.pb((i-h)+W*h);
}
diagonales.pb(add_or(acdiagonal));
}
vi comparaciones;
for (int i=0;i+K<diagonales.size();i++)
comparaciones.pb(add_and(vi{diagonales[i],diagonales[i+K]}));
int distancia_K_1=add_or(comparaciones);
//distancia <=K
diagonales=vi(0);
for (int i=0;i<H+W-1;i++){
vi acdiagonal(0);
for (int h=0;h<H;h++){
if (i-h<W && i-h>=0) acdiagonal.pb((i-h)+W*h);
}
diagonales.pb(add_or(acdiagonal));
}
comparaciones=vi(0);
for (int i=0;i+K<diagonales.size();i++){
vi porcomparar(0);
for (int j=i;j<=i+K;j++) porcomparar.pb(diagonales[j]);
comparaciones.pb(add_or(porcomparar));
}
int res=comparaciones[0];
for (int i=1;i<comparaciones.size();i++)
res=add_xor(vi{res,
add_and(vi{add_not(comparaciones[i-1]),comparaciones[i]})
});
int distancia_less_K_1=res;
//diagonales _|
//distancia K
diagonales=vi(0);
for (int i=0;i<H+W-1;i++){
vi acdiagonal(0);
for (int h=0;h<H;h++){
if (i-h<W && i-h>=0) acdiagonal.pb((W-(i-h)-1)+W*h);
}
diagonales.pb(add_or(acdiagonal));
}
comparaciones=vi(0);
for (int i=0;i+K<diagonales.size();i++)
comparaciones.pb(add_and(vi{diagonales[i],diagonales[i+K]}));
int distancia_K_2=add_or(comparaciones);
//distancia <=K
diagonales=vi(0);
for (int i=0;i<H+W-1;i++){
vi acdiagonal(0);
for (int h=0;h<H;h++){
if (i-h<W && i-h>=0) acdiagonal.pb((W-(i-h)-1)+W*h);
}
diagonales.pb(add_or(acdiagonal));
}
comparaciones=vi(0);
for (int i=0;i+K<diagonales.size();i++){
vi porcomparar(0);
for (int j=i;j<=i+K;j++) porcomparar.pb(diagonales[j]);
comparaciones.pb(add_or(porcomparar));
}
res=comparaciones[0];
for (int i=1;i<comparaciones.size();i++)
res=add_xor(vi{res,
add_and(vi{add_not(comparaciones[i-1]),comparaciones[i]})
});
int distancia_less_K_2=res;
//FINAL
add_or(vi{
add_and(vi{distancia_K_1,distancia_less_K_2}),
add_and(vi{distancia_K_2,distancia_less_K_1})
});
}
Compilation message (stderr)
# | 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... |