using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ int[] a0 = new int[H]; for(int i=0;i>j) & 1) == 1){ lm ^= j == 0 ? 3 : (7<<(j-1)); } } lm &= fm; int[] nMp = (int[]) Mp.Clone(); for(int j=dep-1;j<=dep+1;j++){ if(j<0 || j>=H)continue; nMp[j] ^= lm; } if(dep-1>=0){ if(nMp[dep-1] == 0){ var r = (int[])route.Clone(); r[dep] = i; dfs(nMp,r,dep); } }else{ var r = (int[])route.Clone(); r[dep] = i; dfs(nMp,r,dep); } } } int PopCnt(int bits){ bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555); bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333); bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f); bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff); return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff); } int H,W; int[][] A; public Sol(){ var d = ria(); H = d[0]; W = d[1]; A = new int[H][]; for(int i=0;iint.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }