bitslice ã¨ã¯ Hack the Cell '09 ã«åå ãã¦ç¥ã£ããCellã«éããä¸è¬çã«ä½¿ãããããæ¼ç®ã®é«éåææ³ã«ã¤ãã¦ç´¹ä»ãã¾ãã Bitslice ã¨å¼ã°ããææ³ã§ã¯ããããé ã90度å転ãã¾ããè¨èã§èª¬æãããããã³ã¼ããè¦ãã»ããæ©ãã®ã§ãå転ãããã³ã¼ãã®ä¾ãè¦ã¦ãã ãã int x[32], y[32]; // x ãå ã®ãã¼ã¿ãy ãå転å¾ã®ãã¼ã¿. for (int i = 0; i < 32; ++i) { int t = 0; for (int j = 0; j < 32; ++j) t |= ((x[j] >> i) & 1) << j; // x[j] ã® i ãããç®ã y[i] = t; // y[i] ã® j ãããç®ã«ãã } ãã®å¤æããããã¨ã§ãy[0] ã«ã¯ x[0] - x[31] ã®æä¸ä½ããããã y[1] ã«ã¯ 2çªç®ã®ããã
{{#tags}}- {{label}}
{{/tags}}