import java.io.PrintStream; import java.util.Arrays; import java.util.Scanner; /** * Solution to You Be The Judge, Again * * @author vanb */ public class ybtj2_vanb { /** Input. */ private static Scanner sc; /** Output. */ private static PrintStream ps; /** * Do it! */ private void doit() { int n = sc.nextInt(); int m = 1< (x==0 ? 1 : 3) ) success = false; } if( success ) { // Now test that the three cells of each tile form an L shape. // there should be exactly one center, with one cell (up or down), and one cell (left or right) for( int i=0; i0 && tiling[i-1][j]==x ) sum += 1; if( i0 && tiling[i][j-1]==x ) sum += 2; if( j0 ) success = false; } ps.println( success ? 1 : 0 ); } /** * Main. * * @param args unused * @throws Exception */ public static void main( String[] args ) throws Exception { sc = new Scanner( System.in ); ps = System.out; new ybtj2_vanb().doit(); } }