#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
void construct_network(int H,int W,int K){
vector<int>row,col;
int cur=H*W;
for(int i=0;i<H;i++){
vector<int>Ns;
for(int j=0;j<W;j++){
Ns.pb(i*W+j);
}
int a=add_or(Ns);
cur++;
if(a==1){
row.pb(i);
}
}
for(int j=0;j<W;j++){
vector<int>Ns;
for(int i=0;i<H;i++){
Ns.pb(i*W+j);
}
int a=add_or(Ns);
cur++;
if(a==1){
col.pb(j);
}
}
if(row.size()==2&&col.size()==2){
add_and({row[0]*W+col[0],row[1]*W+col[1]});
add_and({row[0]*W+col[1],row[1]*W+col[0]});
add_or({cur,cur+1});
}
if(row.size()==2&&col.size()==2){
add_and({row[0]*W+col[0],row[1]*W+col[1]});
add_and({row[0]*W+col[1],row[1]*W+col[0]});
add_or({cur,cur+1});
}
else if(row.size()==2&&col.size()==1){
add_and({row[0]*W+col[0],row[1]*W+col[0]});
}
else{
add_and({row[0]*W+col[0],row[0]*W+col[1]});
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
1116 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |