#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200;
int d1[2 * MAX_N - 1], d2[2 * MAX_N - 1];
vector<int> diag1[2 * MAX_N - 1], diag2[2 * MAX_N - 1];
int n, m;
int cellId( int l, int c ) {
if ( l < 0 || c < 0 || l >= n || c >= m )
return -1;
return l * m + c;
}
int solveGreater( int k ) {
for ( int i = 0; i < n; i++ ) {
for ( int j = 0; j < m; j++ ) {
diag1[i + j].push_back( cellId( i, j ));
diag2[i - j + m - 1].push_back( cellId( i, j ));
}
}
vector<int> ans;
for ( int d = 0; d < n + m - 1; d++ ) {
d1[d] = add_or( diag1[d] );
d2[d] = add_or( diag2[d] );
if ( d >= k ) {
ans.push_back( add_and( { d1[d], d1[d - k] } ) );
ans.push_back( add_and( { d2[d], d2[d - k] } ) );
}
}
return add_or( ans );
}
void construct_network( int N, int M, int K ) {
n = N, m = M;
int k = K;
if ( k == n + m - 2 )
solveGreater( k );
else
add_xor( { solveGreater( k ), solveGreater( k + 1 ) } );
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
604 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (1, 1), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
3924 KB |
on inputs (126, 120), (176, 169), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |