#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
vector <int> RowHasBlack;
vector <int> ColumnHasBlack;
vector <int> temp;
int OutputAns_BothRowColumnDifferent(int K){
return ( (RowHasBlack[1]-RowHasBlack[0]) + (ColumnHasBlack[1]-ColumnHasBlack[0]==K) );
}
int OutputAns_OnSameRowColumn(int K){
return 0;
}
void construct_network(int H, int W, int K){
RowHasBlack.clear();
ColumnHasBlack.clear();
for(int i=0;i<H;i++){
temp.clear();
for(int k=0;k<W;k++){
temp.push_back(i*W+k);
}
if(add_or(temp)){
RowHasBlack.push_back(i);
}
}
for(int i=0;i<W;i++){
temp.clear();
for(int k=0;k<H;k++){
temp.push_back(k*W+i);
}
if(add_or(temp)){
ColumnHasBlack.push_back(i);
}
}
if(RowHasBlack.size()==2&&ColumnHasBlack.size()==2){
OutputAns_BothRowColumnDifferent(K);
}else{
OutputAns_OnSameRowColumn(K);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (1, 0), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
1116 KB |
on inputs (196, 156), (197, 156), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |