æ§ç¯:æ°å
ã¾ãããããã°ã©ãã®åé¡ã¨ãã¦æããã¨ããã«ãä¸ã¤å±±ãããå°è±¡ã ãã©ãã¿ããªãã£ããè¶ ãã¦ãã¦ãããï¼ åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ 以ä¸ã®æ£æ´æ°ãããªãé·ã ã®æ°å ã ãä¸ããããããããã®æ°åã®çµã次ã®æ¡ä»¶ãæºãããã©ãããå¤å®ããã 0 㨠1 â¦
èªæãªä¸çãéæã§ãããã¿ã¼ã³ã ã£ãï¼ åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ é·ã ã®éè² æ´æ°å ãä¸ããããããã®æ°åã¯ã©ã®é£æ¥ããäºé ãå¤ãç°ãªãã ãã®æ°åããªãã¹ãå¤ãã® é ã®éè² æ´æ°åã¸ã¨å解ãããå解ã¨ã¯ å解ãããåéè² æ´æ°åã®åé ã足ãã¨ããâ¦
600 ç¹åé¡ã¨ããªãã¨ããããã«æ£è§£è æ°ãå°ãªãã è²ããªäººãè²ããªæ§ç¯ãã¦ããã ãã©ãåãªãã®æ¹æ³ãã°ã åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ ã 以ä¸ã®æ´æ°ã¨ããã ä»¥ä¸ ä»¥ä¸ã®æ´æ°ã 2 åãã¤ãã£ã¦ãããã並ã¹æ¿ãã¦ã§ããé·ã ã®æ°å ã§ãã£ã¦ã ã¨ãªãããâ¦
ããã® Easy ãã¼ã¸ã§ã³ãããã楽ããã¦å¥½ãï¼ï¼ï¼ï¼ï¼ Easyï¼æä½ã®çµæãææã«ãªãå ¥åãæ±ããéåé¡ Hardï¼æä½ã«å ¥åãä¸ããçµæãæ±ããåé¡ ã¨ãã風ã«ãªã£ã¦ãã¦ãæ®éãæä½ã®çµæãæ±ããã ããã®åé¡ã®æ¹ã絶対簡åãªãã¨ãå¤ãã®ã«ãEasy 㨠â¦
証æã¯ã§ãããããã®è¨¼æã«åºã¥ããæ§æãæ°å¦çã«ä¸ãããã¨ã¾ã§ã¯ã§ãããã©ããããå®è£ ã«è½ã¨ãã®ãããã大å¤ãªåé¡ããã åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ æ´æ° ãä¸ãããã¾ãã ã®é å ã§ãã£ã¦ã 次ã®æ¡ä»¶ããã¹ã¦æºãããã®ãåå¨ãããã©ããå¤å®ãã¦ãâ¦
å®è£ ã¯æããã£ããã®ã®ããããªãã«èªä¿¡ã®ãã Greedy ãæåºã§ãã¦ä¸çº AC ã§ãã¦ããã£ã åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ 1 ã ã®å¤ã åãã¤ãã¤é·ã ã®æ°åã§ãã£ã¦ã å ã«ã¤ãã¦ã çªç®ã®å¤ã åç®ã® ã§ãã ã¨ããæ¡ä»¶ãæºãããã®ã 1 ã¤æ§ç¯ãããæ¡ä»¶ãâ¦
åé¡ã¸ã®ãªã³ã¯ åé¡æ¦è¦ 1, 2, ..., N ã並ã¹æ¿ãã¦ã§ããåã§ãã£ã¦ã以ä¸ã®æ¡ä»¶ãæºãããã®ããããã©ããå¤å®ããããã°ãã®ä¾ãã²ã¨ã¤æ§æãã: æé·å¢å é¨ååã®é·ã㯠A æé·æ¸å°é¨ååã®é·ã㯠B å¶ç´ 1 <= N, A, B <= 3 à 105 è§£æ³ LIS and LDS ã¨â¦