ãµã¨ TL ã«åºãã¦ã¿ãã絶対æ¢åºã ã¨æã£ãããæµãããã©ãã©ããã«ããããª...ï¼ï¼ï¼
ã¢ã¤ãã£ã¢èªä½ã¯
- SRM 309 DIV1 Hard StoneGameStrategist
- POJ 1704 Georgia and Bob (è»æ¬ã®ä¾é¡)
ã¨åããã®ã ã£ããããããããåé¡ã«å¯¾ãã¦ãã種ã®ååå¤æãæ½ãã¨ã3 åã¨ãã¾ã£ããåãåé¡ã§ãããã¨ã示ãããããï¼ï¼ï¼ï¼ï¼
ãã¨ãstaircase nim ã¨ããååããããããã
åé¡æ¦è¦
åã®ç³ã®å±±ãå·¦ããé ã«ä¸åã«ä¸¦ãã§ããããããã åã®ç³ãå«ãã§ãããå³ç«¯ã®å±±ã®å³æ¨ªã«ã¯ç³ç½®ãå ´ããããæçµçã«å ¨ã¦ã®ç³ãç³ç½®ãå ´ã«ç§»åããããã¨ãç®æã (å ã«ãã®ç¶æ ã«ããæ¹ãåã¡)ã
å æã¨å¾æã¯äº¤äºã«ç©ºã§ãªãç³ã®å±±ãä¸ã¤é¸ã³ããããã1å以ä¸ã®ç³ãåã£ã¦ãããå³é£ã®å±±ã«ç§»åããããå³ç«¯ã®å±±ããç³ãåã£ãå ´åã¯ããããç³ç½®ãå ´ã«ç§»åãããããäºããæåãå°½ãããã¨ããå æå¾æã©ã¡ããåã¤ã§ããããï¼
å¶ç´
解æ³
ã¾ãã(5, 0, 6, 0, 100, 0, 4, 0, 7, 0) ã¿ãããªãå³ããå¥æ°çªç®ããã¹ã¦ 0ãã¨ããç¤é¢ã¯æ¢ã«å¿ æç¤é¢ã«ãªã£ã¦ãããã¨ã«æ³¨æãããä½æ ãªãä¾ãã°ãã®ç¤é¢ã®ç³ 100 åã®å±±ãã 9 åã¨ã£ã¦
(5, 0, 6, 0, 100, 0, 4, 0, 7, 0) -> (5, 0, 6, 0, 91, 9, 4, 0, 7, 0)
ã¨ããã¨ããç¸æã¯
(5, 0, 6, 0, 91, 9, 4, 0, 7, 0) -> (5, 0, 6, 0, 91, 0, 13, 0, 7, 0)
ã¨ãã¦ãã¾ãã°ããããããã¦åãå½¢ã«æã¡è¾¼ããã¨ãã§ããããã®ãã¨ããããå³ããå¥æ°çªç®ã®åæ°ãã¯ã©ãã§ãããã¦ã
- ã«ã¤ãã¦ã® Nim ãªããããªãã...ï¼
ã¨ããçæ³ãæµ®ãã¶ããã®ãã¨ã示ãã¦ã¿ãã
証æ
以ä¸ã® 3 ã¤ã示ãã°è¯ã:
- ^ ^ ^ ã®ã¨ãã次ã«ã©ã®ãããªæãæã£ã¦ãããã®æ¡ä»¶ãå´©ãã
- ^ ^ ^ ã®ã¨ããä¸æãæãæã¤ãã¨ã§ ^ ^ ^ ã®ç¶æ ã«ã§ãã
- æä½ã¯æéåæ°ã§å¿ ãçµäºããçµå±ç¶æ 㯠^ ^ ^ ã®ç¶æ ã§ãã
ã¾ããå³ããå¥æ°çªç®ã®å±±ã®ã¿ã«çç®ãã¦ã¿ãã¨ãã
- å±±ã 1 ã¤é¸ãã§ç³ã®åæ°ãä»»æã«æ¸ããã (å³é£ã®å±±ããããã¯ç³ç½®ãå ´ã«ç³ãä»»æåæ°ç§»ãæä½ã«å¯¾å¿)
ã¨ããé常㮠Nim ã«å¯¾ãã
- ãã®å±±ã®ç³ã®åæ°ãå°ãã ãå¢ãããã¨ãã§ãã (å·¦é£ã®å±±ããç³ãæã¡è¾¼ã¾ãããã¨ã«å¯¾å¿)
ã¨ããæä½ãã¤ãå ãã£ããã®ã ã¨æããã¨ãã§ãããå®ã¯ãã®ç¨åº¦ã®æä½å¤æ´ã§ã¯ Nim ã¯ãã¯ã¨ãããªãï¼ï¼ï¼
1. ã«ã¤ãã¦
ç³ã®åæ°ãå¢ããæä½ãå ãã£ã¦ããæä½ãè¡ãã¨å¿ ã
- ^ ^ ^
ãå´©ãããã¨ã¯èªæã§ãããç°¡åã®ããã ^ ^ = 0 ãæãç«ã£ã¦ããã¨ãã« ã ã«å¤æ´ãããã®ã¨ããããã®ã¨ãã¾ã XOR ã®æ§è³ªãã
^ =
ãæãç«ã£ã¦ããããã
^ ^ = ^
ã¨ãªãã ã§ãªãéãã ^ ^ = ã¨ã¯ãªããªããã¨ããããã
2. ã«ã¤ãã¦
ããã«ã¤ãã¦ã¯ãç³ã®åæ°ãå¢ãããã¨ããæä½ã®è¿½å ã¯ä½ãæå³ãæããªããå¾æ¥ã®ãç³ã®åæ°ãä»»æã«æ¸ããããã¨ããæä½ã ãã§
- ^ ^ ^ ã®ç¶æ ãã ^ ^ ^ ã®ç¶æ ã«ãããã¨
ãå®ç¾ã§ããã®ã¯ãé常㮠Nim ã¨åãã§ããã
3. ã«ã¤ãã¦
é常㮠Nim ã«ãç³ã®åæ°ãå¢ãããæä½ã追å ãããã®ãå®è³ª Nim ã¨åãã ã¨è¨ã£ãããå³å¯ã«ã¯ãã¡ãä½æ ãªããã®å ´åãã²ã¼ã ãç¡éã«ç¶ãããã¨ãã§ãã¦ãã¾ãããããã
ã§ãããã®åé¡ã®ã²ã¼ã ã®å ´åã¯ã
ã®å¤ã常ã«å調æ¸å°ãªã®ã§æéåæ¢æ§ãä¿è¨¼ã§ãããããã¦çµå±æã®åå±±ã®ç³ã®åæ°ã¯ ã§ããããã㯠^ ^ ^ ã®ç¶æ ã§ããã
ã¾ã¨ã
以ä¸ããã
- ^ ^ ^ ãªãã°å¾æå¿ å
- ^ ^ ^ ãªãã°å æå¿ å
ã§ãããã¨ãå°ãããã