#include <bits/stdc++.h>
using namespace std ;
#define pb push_back
typedef vector < int > vi ;
#include "vision.h"
int n , m ;
vi R , C , last ;
int f ( int i , int j ) {
return i * m + j ;
}
void solve1 () {
vi Ret ;
Ret .pb ( add_xor ( R ) ) ;
Ret .pb ( add_xor ( C ) ) ;
vi AdjOnes ;
for ( int i = 0 ; i < n - 1 ; i ++ ) {
vi crnt ;
for ( int j = 0 ; j < n ; j ++ ) {
if ( j == i || j == i + 1 ) continue ;
crnt .pb ( R [j] ) ;
}
crnt .pb ( add_not ( add_or ( { R [i] , R [i+1] } ) ) ) ;
AdjOnes .pb ( add_or ( crnt ) ) ;
}
Ret .pb ( add_and ( AdjOnes ) ) ;
last .pb ( add_not ( add_or ( Ret ) ) ) ;
}
void solve2 () {
vi Ret ;
Ret .pb ( add_xor ( R ) ) ;
Ret .pb ( add_xor ( C ) ) ;
vi AdjOnes ;
for ( int i = 0 ; i < m - 1 ; i ++ ) {
vi crnt ;
for ( int j = 0 ; j < m ; j ++ ) {
if ( j == i || j == i + 1 ) continue ;
crnt .pb ( C [j] ) ;
}
crnt .pb ( add_not ( add_or ( { C [i] , C [i+1] } ) ) ) ;
AdjOnes .pb ( add_or ( crnt ) ) ;
}
Ret .pb ( add_and ( AdjOnes ) ) ;
last .pb ( add_not ( add_or ( Ret ) ) ) ;
}
void construct_network ( int H , int W , int K ) {
n = H , m = W ;
for ( int i = 0 ; i < n ; i ++ ) {
vi ret ;
for ( int j = 0 ; j < m ; j ++ ) {
ret .pb ( f ( i , j ) ) ;
}
R .pb ( add_xor ( ret ) ) ;
}
for ( int j = 0 ; j < m ; j ++ ) {
vi ret ;
for ( int i = 0 ; i < n ; i ++ ) {
ret .pb ( f ( i , j ) ) ;
}
C .pb ( add_xor ( ret ) ) ;
}
solve1 () ;
solve2 () ;
add_or ( last ) ;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
on inputs (0, 0), (1, 1), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
21 ms |
2048 KB |
on inputs (57, 107), (59, 108), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |