#include "vision.h"
#include<bits/stdc++.h>
#define sz(x) ll(x.size())
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
const ll MAX=1e6;
int n, m, k;
vector<int>c,z,f,q, ans;
void looks(int dist_c, int dist_f){
int aux=dist_c;
int a=1, b=1;
//cout<<"aa "<<dist_c<<' '<<dist_f<<'\n';
for(int i=0; i<sz(c)-dist_c; i++){
z.pb(add_and({c[i],c[aux]}));
aux++;
}
aux=dist_f;
//cout<<"ss"<<'\n';
for(int i=0; i<sz(f)-dist_f; i++){
q.pb(add_and({f[i],f[aux]}));
aux++;
}
if(!(sz(z) && sz(q)))return;
a=add_or(z);
b=add_or(q);
ans.pb(add_and({a,b}));
q.clear();
z.clear();
//cout<<"ns"<<'\n';
}
void construct_network(int H, int W, int K){
n=H;
m=W;
k=K;
for(int i=0; i<n; i++){//por filas
for(int j=0; j<m; j++){
q.pb(i*m+j);
}
f.pb(add_or(q));
q.clear();
}
for(int j=0; j<m; j++){//por columnas
for(int i=0; i<n; i++){
z.pb(i*m+j);
}
c.pb(add_or(z));
z.clear();
}
//diferentes columnas y filas
for(int dis=1; dis<k; dis++){
looks(dis, k-dis);
}
//cout<<"avocado???????????????????????????????????"<<'\n';
int a=add_or({add_xor(c),add_xor(f)});//debe ser 1 else 0
//igual columna
int aux=k;
for(int i=0; i<sz(c)-k; i++){
z.pb(add_and({c[i],c[aux]}));
aux++;
}
int b=1;
if(sz(z)){
b=add_and({a,add_or(z)});
ans.pb(b);
}
// igual fila
aux=k;
for(int i=0; i<sz(f)-k; i++){
q.pb(add_and({f[i],f[aux]}));
aux++;
}
if(sz(q)){
b=add_and({a,add_or(q)});
ans.pb(b);
}
add_or(ans);
return;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
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), (0, 1), expected 0, but computed 1 |
3 |
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), (0, 1), expected 0, but computed 1 |
3 |
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), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
1240 KB |
WA in grader: Too many instructions |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Incorrect |
2 ms |
604 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
1116 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
3 ms |
860 KB |
Output is correct |
8 |
Correct |
2 ms |
860 KB |
Output is correct |
9 |
Correct |
5 ms |
1200 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |