ãŠè“åã®é”女 CHARLOTTE ã¯å·´ãƒžãƒŸã¨ã‚¯ãƒƒã‚ーゲームを楽ã—ã‚“ã§ã„る.クッã‚ーゲーム㯠8\times 8 ã®æ ¼å状ã«åŒºåˆ‡ã‚‰ã‚ŒãŸãƒ†ãƒ¼ãƒ–ルクãƒã‚¹ã®ä¸Šã«ãƒãƒ¼ã‚ºã‚¯ãƒƒã‚ーã¨ãƒãƒ§ã‚³ãƒ¬ãƒ¼ãƒˆã‚¯ãƒƒã‚ーを置ã„ã¦è¡Œã‚れる.å„æ ¼åã«ã¯é«˜ã€… 1 個ã®ãƒãƒ§ã‚³ãƒ¬ãƒ¼ãƒˆã‚¯ãƒƒã‚ーã¾ãŸã¯ãƒãƒ¼ã‚ºã‚¯ãƒƒã‚ーã—ã‹ç½®ãã“ã¨ã¯ã§ããªã„.
ãŠè“åã®é”女ã¯ãƒãƒ¼ã‚ºã‚¯ãƒƒã‚ーを,巴マミã¯ãƒãƒ§ã‚³ãƒ¬ãƒ¼ãƒˆã‚¯ãƒƒã‚ーを交互ã«ç½®ã„ã¦ã‚²ãƒ¼ãƒ ã‚’è¡Œã†ï¼Žè‡ªåˆ†ã®ã‚¯ãƒƒã‚ーを置ã„ãŸã‚ã¨ï¼Œãã®ã‚¯ãƒƒã‚ーã‹ã‚‰ä¸Šä¸‹å·¦å³æ–œã‚ã®å„ 8 æ–¹å‘ã«ã¤ã„ã¦ï¼Œç½®ãクッã‚ーã¨ã™ã§ã«ç½®ã„ã¦ã„ãŸè‡ªåˆ†ã®ã‚¯ãƒƒã‚ーã®é–“ã«ç›¸æ‰‹ã®ã‚¯ãƒƒã‚ーã®ã¿ãŒç›´ç·šã«ä¸¦ã‚“ã§ã„ãŸå ´åˆã«ï¼Œãã®æŒŸã¾ã‚ŒãŸç›¸æ‰‹ã®ã‚¯ãƒƒã‚ーã®ã™ã¹ã¦ãŒè‡ªåˆ†ã®ã‚¯ãƒƒã‚ーã§ç½®ãæ›ãˆã‚‰ã‚Œã‚‹ï¼Žã‚¯ãƒƒã‚ーゲームã®ãƒ—レイヤーã¯è‡ªåˆ†ã®ã‚¿ãƒ¼ãƒ³ãŒå›žã£ã¦ããŸæ™‚,1 ã¤è‡ªåˆ†ã®ã‚¯ãƒƒã‚ーを置ãã“ã¨ãŒã§ãる.ãŸã ã—,相手ã®ã‚¯ãƒƒã‚ーを少ãªãã¨ã‚‚ 1 ã¤ä»¥ä¸Šè‡ªåˆ†ã®ã‚¯ãƒƒã‚ーã«ç½®ãæ›ãˆã‚‰ã‚Œãªã‘ã‚Œã°ãªã‚‰ãªã„.ãã®ã‚ˆã†ãªç½®ãå ´ãŒãªã„å ´åˆï¼Œè‡ªåˆ†ã®ã‚¿ãƒ¼ãƒ³ã‚’パスをã—ãªã‘ã‚Œã°ãªã‚‰ãªã„.
ãŠè“åã®é”女も巴マミも考ãˆã‚‹ã®ãŒå°‘々苦手ã§ã‚る.ãã“ã§ï¼Œå›žã£ã¦ããŸã‚¿ãƒ¼ãƒ³æ¯Žã«ãã®ã‚¿ãƒ¼ãƒ³ã®ä¸ã§ç½®ãæ›ãˆã‚‰ã‚Œã‚‹ã‚¯ãƒƒã‚ーã®æ•°ã‚’最大化ã™ã‚‹ã“ã¨ã‚’考ãˆã‚‹ã“ã¨ã«ã—ãŸï¼Žå·´ãƒžãƒŸã®ã‚¿ãƒ¼ãƒ³ã®ã¨ãã«ç½®ãæ›ãˆã‚‰ã‚Œã‚‹ã‚¯ãƒƒã‚ーã®æ•°ã‚’最大ã«ã™ã‚‹ã‚ˆã†ãªã‚¯ãƒƒã‚ーを置ãå ´æ‰€ã®å€™è£œãŒè¤‡æ•°ã‚ã‚‹å ´åˆã¯ï¼Œã‚ˆã‚Šä¸Šã®å ´æ‰€ã‚’,ãã‚Œã§ã‚‚複数ã‚ã‚‹å ´åˆã¯ã‚ˆã‚Šå·¦ã®å ´æ‰€ã‚’é¸æŠžã™ã‚‹ã“ã¨ã«ã—ãŸï¼Žã¾ãŸåŒæ§˜ã«ï¼ŒãŠè“åã®é”女ã®ã‚¿ãƒ¼ãƒ³ã®ã¨ãã«å€™è£œãŒè¤‡æ•°ã‚ã‚‹å ´åˆã¯ã‚ˆã‚Šä¸‹ã®å ´æ‰€ã‚’,ãã‚Œã§ã‚‚複数ã‚ã‚‹å ´åˆã¯ã‚ˆã‚Šå³ã®å ´æ‰€ã‚’é¸æŠžã™ã‚‹ã“ã¨ã«ã—ãŸï¼Ž
テーブルクãƒã‚¹ã«ç½®ã‹ã‚ŒãŸã‚¯ãƒƒã‚ーã®çŠ¶æ…‹ãŒä¸Žãˆã‚‰ã‚Œã‚‹ã®ã§ï¼Œå·´ãƒžãƒŸã‹ã‚‰ã¯ã˜ã‚,彼女ãŸã¡ãŒãã“ã‹ã‚‰ã‚¯ãƒƒã‚ーゲームを行ã„,共ã«æ–°ãŸãªã‚¯ãƒƒã‚ーãŒç½®ã‘ãªããªã‚‹ã¾ã§ã‚²ãƒ¼ãƒ を続ã‘ãŸæ™‚ã®ãƒ†ãƒ¼ãƒ–ルクãƒã‚¹ã®ä¸Šã«ç½®ã‹ã‚ŒãŸã‚¯ãƒƒã‚ーã®çŠ¶æ…‹ã‚’求ã‚よ.
入力ã¯ä»¥ä¸‹ã®å½¢å¼ã§ä¸Žãˆã‚‰ã‚Œã‚‹ï¼Ž
s_{11} s_{12} ... s_{18}\\ s_{21} s_{22} ... s_{28}\\ ...\\ s_{81} s_{82} ... s_{88}\\
s_{ij} ã¯ãƒ†ãƒ¼ãƒ–ルクãƒã‚¹ã«ç½®ã‹ã‚ŒãŸã‚¯ãƒƒã‚ーã®åˆæœŸçŠ¶æ…‹ã‚’表ã™æ–‡å—ã§ï¼Œä¸Šã‹ã‚‰ i 行目,左ã‹ã‚‰ j 列目ã®æ ¼åã®çŠ¶æ…‹ã‚’表ã™ï¼Žãƒãƒ§ã‚³ãƒ¬ãƒ¼ãƒˆã‚¯ãƒƒã‚ーãŒç½®ã‹ã‚Œã¦ã„ã‚‹ã¨ãs_{ij}㯠'o'
ã§ã‚り,ãƒãƒ¼ã‚ºã‚¯ãƒƒã‚ーãŒç½®ã‹ã‚Œã¦ã„ã‚‹ã¨ã㯠'x'
, 何も置ã‹ã‚Œã¦ã„ãªã„ã¨ã㯠'.'
ã¨ãªã‚‹ï¼Ž
クッã‚ーゲームãŒè¡Œã‚ã‚ŒãŸå¾Œã®ãƒ†ãƒ¼ãƒ–ルクãƒã‚¹ã®ä¸Šã«ç½®ã‹ã‚ŒãŸã‚¯ãƒƒã‚ーã®çŠ¶æ…‹ã‚’,入力形å¼ã¨åŒã˜å½¢å¼ã§å‡ºåŠ›ã›ã‚ˆï¼Ž
'o'
, 'x'
, '.'
ã®ã„ãšã‚Œã‹ã§ã‚る.ooox.... .x...... ooo..... ........ ........ ........ ........ ........
ooooo... .o...... ooo..... ...o.... ....o... ........ ........ ........
........ ........ ........ ...ox... ...xo... ........ ........ ........
xxxxxxxx xxxooxxx xxxxooxx xxxxxxxx ooxxooox ooxoooox oxooooox ooooooox
........ ........ ..ooo... ..oxo... ..ooo... ........ ........ ........
........ ........ ..ooo... ..ooo... ..ooo... .....o.. ......o. ........