Submission #298143

# Submission time Handle Problem Language Result Execution time Memory
298143 2020-09-12T12:39:29 Z infinite_iq Vision Program (IOI19_vision) C++14
0 / 100
21 ms 2048 KB
#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 ) ) ;
        Ret .pb ( add_and ( { add_or ( R ) , add_or ( 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 ) ) ;
        Ret .pb ( add_and ( { add_or ( R ) , add_or ( 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 ) ;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Incorrect 1 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 21 ms 2048 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 3 ms 512 KB Output is correct
4 Correct 5 ms 640 KB Output is correct
5 Incorrect 1 ms 384 KB WA in grader: Instruction with no inputs
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -