è³¢ã漸åå¼
ä¸è¦ããã¨è¨ç®éãå³ããåé¡ã«ãè¦ãããã¡ãã£ã¨ããçºæ³ã®è»¢æãå¿ è¦ã«ãªãã åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ æ£ã®æ´æ° ãä¸ããããã次ã®æ¡ä»¶ãæºãã åã®æ´æ° ã®çµãä½åãããã 100000 ã§å²ã£ãå¤ãæ±ããã å¶ç´ [tex 1 \le N \le 7] èããã㨠å®ç´ã«â¦
åå²æ°ã§é®®ããã«è§£ããï¼ åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ 人ã®ã¯ã©ã¹ã§ç·é¡ åãéãããã¨ã«ããã ãã®ã¯ã©ã¹ã®çå¾ã¯çè¦æ ã£å¼µãã§ãããåºå¸çªå·é ãï¼ã¤åã®çå¾ã«æ¯ã¹ã¦ å以ä¸é«ãéé¡ãå¯ä»ããªãã¨æ°ãæ¸ã¾ãªãã ãã®æ¡ä»¶ãæºããæ¹æ³ã®åæ°ã 1000000â¦
åå²æ°ã®ããæãã®åé¡ï¼ åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ é·ã ã®æ°å killA, killB ãä¸ããããããã® 2 ã¤ã®åºç¾©å調æ¸å°ã§ããã 次ã®æ¡ä»¶ãæºããé·ã ã®æ°å deathA, deathB ã®çµã®åæ°ã 1000000007 ã§å²ã£ããã¾ããæ±ããã killA ã®ç·å = deathB ã®ç·â¦
opt ããã®å¾æç³»ã£ã¦æãã ã£ãï¼ åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ ä¸è¾ºã®é·ããæ´æ° ã®æ£ è§å½¢ãããã é ç¹ããå§ãã¦ãå¨ä¸ã«è·é¢ 1 ãã¨ã«é»ãç³ãç½ãç³ãç½®ãã¦ããã ç³ã®ç½®ãæ¹ã®ãã¡ãå辺ä¸ã«ããç½ãç³ã®åæ°ãçãããªããããªãã®ã®åæ°ã 998244353 â¦
ä¸ä¹ã®è§£æ³ã¯ããã«åºã¦ããã®ã§ããããä¸æã«é«éåããï¼ åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ ã®ã°ãªãããä¸ããããã"." ãã¹ (éè·¯) ã«ã¯è¡ããã "#" ãã¹ (å£) ã«ã¯è¡ããªããå·¦ä¸ã®ãã¹ããå³ä¸ã®ãã¹ã¸ã¨è¡ããããæ¯åã®ã¿ã¼ã³ã§ä»¥ä¸ã®ããããã®è¡åãã¨â¦
ããã㪠DP ãèãããããï¼ åé¡ã¸ã®ãªã³ã¯ editorial åé¡æ¦è¦ æ£æ´æ° ãä¸ãããã以ä¸ã®æ¡ä»¶ãå ¨ã¦æºããæçæ°ã®å¤ééåã¯ä½ç¨®é¡åå¨ãããã998244353 ã§å²ã£ããã¾ããæ±ããã å¤ééåã®è¦ç´ æ°ã¯ å¤ééåã®è¦ç´ ã®ç·å㯠å¤ééåã®è¦ç´ ã¯å ¨ã¦ (â¦
ãã®ã»ããã® writer ããã¦ãã¾ãã åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ ã並ã³æ¿ãã¦ã§ããæ°å 㯠éããããããã®ãã¡ä»¥ä¸ã®æ¡ä»¶ãæºãããã®ãä½éãããããã1000000007 ã§å²ã£ããã¾ããæ±ããã ãæºãããã㪠ãã¡ããã© å ãæºãããã㪠ãã¡ããã© å â¦
ããªãã ã®ãã¯ã³ã´ããã®ææ¦ç¶ã§ãåå²æ°ãç¨ããåé¡ãåºé¡ãããã®ã§ãå¨è¾ºã®è©±é¡ãæ´çãã¦ã¿ã¾ããã æ°ãä¸ãã«é¢ãã話é¡ã¨ãã¦åå²æ°ãã¹ã¿ã¼ãªã³ã°æ°ã¯ææç»å ´ãã¾ãããã©ã¡ããåå12ç¸ã¨å¼ã°ããåºãæ çµã¿ã«å«ã¾ãã¦ãã¾ããä»åã¯åå²æ°ããâ¦