AtCoderã§æ°´è²ã«ãªãã¾ã§ã«ãã£ãäºã¨ããã¾ã¨ãã
ããã«ã¡ã¯ã3/17ã®ABC091ã§ç¡äºæ°´è²ã«ãªãäºãã§ããã®ã§ãä»ã¾ã§ã«ãã£ã¦ããäºã¨æ°´è²ã«ãªãããã«å¿
è¦ã ã¨æããäºãã¾ã¨ãããã¨æãã¾ãã
ãã®è¨äºã«è¼ã£ã¦ããå
容ã¯ããã¾ã§å人ã®æè¦ãªã®ã§ãããã¾ã§åèç¨åº¦ã«ãé¡ããã¾ãã
ã¾ããç§èªèº«ãæ°´è²æåºè¾ºã®äººéãªã®ã§ç¥èãæµ
ããããã¤ãééã£ã¦ããç¹ãããããããã¾ãããã容赦ãã ããã
èªåèªã
å¡æ¬@shibh308ã§ããå·çæç¹ã§ã®ã¬ã¼ãã¯1215ã§ãä»ã¾ã§ã®ã¬ã¼ãæ¨ç§»ã¯ãããªæã(ä¸ç»ååç
§)ã§ãã
競æããã°ã©ãã³ã°ãæ¬æ ¼çã«ããå§ãããã£ããã¯å»å¹´ã®12æãããJOIäºé¸ã§300ç¹çæ»ããã¡ãã®ããã£ããã§ãããå½æã¯ã¢ã«ã´ãªãºã ã«ã¤ãã¦ã®ç¥èãå
¨ããªãã£ãã®ã§ã200ç¹åé¡ã§ãã解ãããæªãããããªã¬ãã«ã ã£ãã¨è¨æ¶ãã¦ãã¾ãã
å½æã®ã³ã¼ãã¯ãããªæãã§ããããã®æã¯Båé¡ãæéãã£ã±ã使ã£ã¦ãã£ã¨è§£ããã¿ãããªç¶æ
ã§ããâ¦
ãããã競ããã«é¢ããåºç¤çãªèãæ¹ãå¦ã³ã2å®ã3å®ã§å®å®ããããã«ãªãã¾ããããã®æç¹ã§ã®å¹³åããã©ã¯900ç¨åº¦ã§ã300ç¹åé¡ã解ããã解ããªããã®ã©ã¤ã³ã ã£ãã¨æãã¾ãã
1æã2æã«ããã¦300ç¹åé¡ãåãããè»æ¬ã®åç´ç·¨ãèªãã ããã¦ã2æä¸æ¬ã«ãã£ãABC088ã§å
¨å®ããäºãã§ãã¾ãããããããã¯ã10ã30åã§3å®âä½è£ãããã°Dã«åãæãããã¿ãããªæµããç¶ãã¦ããã©1350-1550辺ããç¶æããç¡äºã«æ°´è²ã«ãªãäºãã§ãã¾ããã
æ°´è²ã«ãªãããã«å¿ è¦ãããªäº
ç§ã®ããã¾ã§ã®çµé¨ã¨åè¦ãå
ã«ããããã ãã§ããããã«ãªãã°æ°´è²ã«ãªããï¼ãã¿ãããªç®å®ã¨ç¥ã£ã¦ããã¹ãã¢ã«ã´ãªãºã ãèå¯ã®ã³ãã«ã¤ãã¦ã¾ã¨ãã¾ããã
ã³ã³ãã¹ãé ä½ãåé¡ã«ã¤ãã¦
é ä½ãããã©ã®ç®å®
ã»ABCã§ratedå
110ã70ä½è¾ºããç¶æãã
ã»ABCãAGCã§ããã©1300-1500辺ããç¶æãã
ã»çæ»ããªã
300ç¹åé¡ã®æ©è§£ãããã§ããã°ä¸äºã¤ã¯æ¥½ã«éæã§ããã¨æãã¾ãã(ABC-Dã極端ã«ç°¡åãªå ´åãé¤ã)
å人çã«ã¯çæ»ããªãäºãä¸çªéè¦ã ã¨æã£ã¦ãã¾ããABC-Cã«80åããã¦4WA3å®ã¨ãAGC-Aã§5WA0å®ã¨ãããã¨ã¬ã¼ããã¤ãããããä¸ãã£ã¦é常ã«ã¤ããã§ããæ°ãã¤ãã¾ããã(èªæ)
解ããããã«ãã¹ãåé¡ã®ç®å®
ã»300ç¹åé¡ã®ãã¡8å²ãããã30åã§è§£ããããã«ãã
ã»400ç¹åé¡ã®ååããããæéå
ã«è§£ããããã«ãã
500ç¹ä»¥éã¯æéå
ã«è§£ããªãã¦ãå
¨ãåé¡ãªãã§ãã
ABC-Dã§500ç¹ä»¥ä¸ãåºãå ´åã¯3å®ã§ãããã©1600ãåããäºãå¤ãã®ã§ã3å®æ©è§£ããæèããæ¹ãããã¨æãã¾ãã
åé¡ã解ãããã«ä½¿ãç¥èã«ã¤ãã¦
使ããããã«ãã¦ããã¹ãäºãç¥ã£ã¦ããã¹ãæ§è³ª
ã»å¹
åªå
æ¢ç´¢ãæ·±ãåªå
æ¢ç´¢
ã»é åã®å
¨åæ(next_permutationã使ãã¨æ¥½)
ã»2nã3néãã®å
¨åæ(bitæ¼ç®ã§ãé¢æ°ã使ã£ãåæã§ã)
ã»æ¨ã®åºæ¬çãªæ§è³ª(辺ã®æ°ãN-1ã«ãªãäºã¨ãäºç¹éã®éãå¿
ãä¸ã¤ãªäºã¨ããåºæ¬çãªäºã ã)
ã»æå°å
¬åæ°ãæ大å
¬ç´æ°ã®è¨ç®(ã©ã¤ãã©ãªã¨ãã¦æã£ã¦ããã¨æ¥½)
ã»ç´¯ç©å(ä¸æ¬¡å
ã®ã¿)
ã»é¤ç®ãé¤ãååæ¼ç®ã®MODè¨ç®
ã»ãã¤ã¯ã¹ãã©æ³ã使ã£ãæççµè·¯è¨ç®
ã»Union-Findæ¨(ãªãã¦ã解ãããã©ããã¨ç°¡åã«ãªãåé¡ãããªãå¤ãå°è±¡)
ã»æ¼¸åå¼ã使ã£ãç°¡åãªDP(確çDPã¨ãæ¡DPã¯å¿
é ãããªãã§ã)
ã»ç´æ°è¨ç®ãç´ å æ°å解ãã¨ã©ã¹ãããã¹ã®ç¯©ã使ã£ãç´ æ°åæ
ã»ã¡ã¢åå帰(éè¤è¨ç®ãé¿ãã¦è¨ç®éãè½ã¨ã)
ã»upper_bound,lower_boundã使ã£ãé
åã®äºåæ¢ç´¢
ãã¾ãé«åº¦ã§ãªããã®ã¯çãã¦ãã¾ããããããããããªæãã ã¨æãã¾ãã
ãã¡ããå
¨ã¦ãå¿
é ãªè¨³ã§ã¯ãªãã§ããããããã身ã«ã¤ãã¦ããã¨300ç¹ã400ç¹åé¡ã解ãã®ãããªã楽ã«ãªãã¯ãã§ãã
å¿ é ã§ã¯ãªããã©ä½¿ããã¨ä¾¿å©ãªã¢ã«ã´ãªãºã ãç¥è
ã»ä»»æã®äºç¹éã®æççµè·¯è¨ç®(ã¯ã¼ã·ã£ã«ããã¤ãæ³)
ã»è² ã®çµè·¯ã®æ¤åº(ãã«ãã³ãã©ã¼ãæ³)
ã»é¤æ³ã®MODè¨ç®(MOD=109+7ã®æã ãç¥ã£ã¦ããã°ååã£ã½ã)
ã»çµåããéè¤çµåã(åãã£ã¦ãã¼ãã«ãä½ãã¨æ¥½)
ã»ç¢ºçãæå¾
å¤è¨ç®(ã¼ãã¯ããããã£ã¦ã¾ãã)
ã»ãããã¨ãæ³
ã»äºæ¬¡å
ç´¯ç©å
ã»æå°å
¨åæ¨(ã¯ã©ã¹ã«ã«æ³ã§ãããªã æ³ã§ããã)
ã»äºé¨ãããã³ã°åé¡(ã©ã¤ãã©ãªãæã£ã¦ãã¨ä¾¿å©)
ã»æ大ããã¼ãæå°ã«ãã(åä¸ ã©ã¤ãã©ãªã ãæã£ã¦ãã°ããã§ã 使ãæ©ä¼å°ãªã)
ã»bitDPãæ¡DP(ç¥ã£ã¦ããã¦æã¯ãªãã£ã¦ç¨åº¦)
ã»æ¨ãDAGä¸ã§ã®ç°¡åãªDP(ã¡ã¢åãã¦è¨ç®éãè½ã¨ãåé¡)
ã»è©ä¾¡ããé¢æ°ãç¨æããã¿ã¤ãã®äºåæ¢ç´¢
ãã®è¾ºãã®ç¥èã¯åºæ¬çã«ABC-D以éã§ããè¦æ±ãããªã(ã¯ã)ãªã®ã§ãããç¥ã£ã¦ããã¨400ã500ã解ãæã«å½¹ç«ã¤ããããã¾ããã
ãã ãæ°´è²ã«ãªãã ããªããããã®ç¥èãå
¨ããªãã¦ãåé¡ãªãã¨æãã¾ãã
æ°´è²ã«ãªãã¾ã§ã«ä½¿ããªã(è¦æ±ãããªã)ç¥è
ã»ãããã¸ã«ã«ã½ã¼ã(使ããäºããããã©ãæ³å®è§£ã§ã¯å¿
è¦ãªãäºãå¤ãæ°ããã)
ã»ã»ã°ã¡ã³ãæ¨ãé
延ã»ã°æ¨ãBITçã®ãã¼ã¿æ§é (ãããã¸ã«ã«ã½ã¼ãã¨åæ§ ABCã§ã¯åºæ¬å¿
è¦ã«ãªããªã)
ã»ååå
¨åæ(使ããããã«ãªã£ã¦æã¯ãªããã©ã400ç¹åé¡ã§ã¯å¤ååºãªãããâ¦)
ã»ãããªã³ã°
ã»xoræ¼ç®ä»ãããæ¼ç®ã®æ§è³ª(ABCã§ãåºãäºã¯ãããã©ãåºæ¬çã«500ç¹ä»¥ä¸ã®é«é£æ度åé¡ãªã®ã§è¦ããªãã¦ããã§ã)
ã»å¹¾ä½åé¡ã§ä½¿ããããã(è¦ããå¿
è¦ã¯ãªãã§ã ç°¡åãªãã®ã¯ãã®é½åº¦èª¿ã¹ãã°ããã®ã§â¦)
ã»æ©ãé¢ç¯ç¹ã®æ¤åº(ABCã§å¿
è¦ã«ãªãäºã¯ã»ã¨ãã©ãªãã¯ã)
ã»ä¸åæ¢ç´¢
ã»ãã®ä»ãªããé£ãããã¤è²ã
ãã®è¾ºã«ãªãã¨ã¾ãABCã§ã¯å¿
è¦ã«ãªããªãã§ãã
ä¸ã®æ¹ã¯ç¥ã£ã¦ããã¨æ¥½ã«ãªãäºãããã¾ãããæ°´è²ã«ãªãã ããªãæ£ç´å
¨ãå¿
è¦ãªãã®ã§â¦
èå¯ããæã®ãã¤ã³ã
300ç¹ä»¥ä¸ã®åé¡ã«ãªãã¨è³æ»ã§å
¨æ¢ç´¢ãã訳ã«ãè¡ããªãã®ã§ãåé¡ãèå¯ããå¿
è¦ãåºã¦ãã¾ãã
ããã§ããã¤ãèå¯æã®(åºæ¬çãª)ãã¤ã³ããæãããã¨æãã¾ãã
(â»èª¬æã®éä¸ã«ããã¤ãã®åé¡ã®ãã¿ãã¬ãå«ãã§ãã¾ãï¼ãã®ãããªãªã³ã¯ãæ¼ãã¨åé¡ãã¼ã¸ã«é£ã¶ããã«ãªã£ã¦ããã®ã§ããã¿ãã¬ãé¿ãããæ¹ã¯åé¡ãã¼ã¸ã¸ã®ãªã³ã¯ãè¸ã¾ãªãããã«ããã¨ããããã§ãã)
ã¨ããããå¶ç´ãè¦ã
ããã大äºã§ããè¦å¿ãããä¸å¤§äºã§ãã
N<=105ãªãN2ãéã«åããªãã¨ãN<=16ãªã2Nãä½è£ãæã£ã¦éãã¨ãN<=8ãªãN!ã§ãååéãã¨ããå¶ç´ããåããäºã¯ããããããã¯ãã§ãã
ãã®åé¡ãªãããåãããããä¾ãªã®ã§ãããN!ãéãäºã«æ°ã¥ããã«é£ãã解æ³ãèãã¦æéã溶ããã¦ãã¾ãäºãç¨ã«ããããã®ã§æ³¨æãã¾ãããã(èªæ)
ç®æ°ã£ã½ãåé¡(ããã¨ãããã¨ã)ã«ãããã¡ãªãO(1)ã§ã解ãããã©O(N)ãO(N2)ã§è§£ããæ¹ã楽ãã¿ãããªåé¡ã¯ç¡çãã¦O(1)解æ³ãèããå¿
è¦ã¯ãªãã§ãã
ã¾ããè¤æ°ããå¶ç´ã®ãã¡ã©ãããé常ã«å°ããå ´å(ä¾:N<=105,M<=10)ãå°ããæ¹ã®å¶ç´ã«çç®ãã¦ä½ãã§ããªãããèããã¨èå¯ãã¹ã ã¼ãºã«é²ãã ããã¾ãã
åé¡æãã¡ããã¨èªã
ããæ¸ãã¨é¦¬é¹¿ã«ãã¦ããã¨åéããããããªã®ã§ãããåé¡æãã¡ããã¨èªãäºã¯é常ã«å¤§åã§ãããããæ¬å½ã«ã
3å®æ©è§£ãã»ããã§èª¤èªãã¦30å溶ããã¨ããã£ã¡ããã¨æ²ããããã®ã§ãåé¡æãã¡ããã¨èªã¿ã¾ãããã
ãèªåã®å®¶ä»¥å¤ã®å®¶ãå°ãªãã¨ã1è»è¨ªãããããèªå以å¤ã®å®¶ãã¹ã¦ãå°ãªãã¨ã1å訪ãããã¨åéããã¦ãアッããå·¡åã»ã¼ã«ã¹ãã³åé¡ãããï½ï½ï½ï½ï½ï½ï½ç¡çããï½ï½ï½ï½ï½ï½ï½ãã¨ãèãã¦ã馬鹿ããã®ãé¡ãã§ãã誤èªã¯çµ¶å¯¾ã«é¿ãã¾ãããã
æè¨ç®ã§ããã±ã¼ã¹ã人åã§è§£ãã¦ã¿ã
ç¹ã«ã²ã¼ã ç³»ã®åé¡ã ã¨å¤ãã®ã§ããããã¿ã¼ã³ãå
¨ã¦ç´ã«æ¸ãåºãã¦ã¿ãã¨æ³åæ§ã«æ°ã¥ããäºãããããã¾ãããæé©ãªè¡åãããå ´åã©ããªããããæ±ãããã®åé¡ãã(ã²ã¼ã åã§ã¯ãªãã§ãã)ãã®åé¡ãªã©ã¯æè¨ç®ã§ããç¯å²ã§æ¸ãåºãã¦ã¿ãã¨èå¯ãé常ã«æ¥½ã«ãªãã¾ãã
åé¡ãæä½ãç°¡åã«ã§ããªããèãã
åé¡æã®ä½è¨ãªé¨åãåãè½ã¨ãã¦èããã®ã¯ããã¯ãããªã®ã§ãããåé¡æãè¦ã¦ããã®ã°ã©ãå®è³ªæ¨ãããï½ï½ï½ï½ãã¨ããアッãã®å
¥åçãã«é¢ä¿ãªããããï½ï½ï½ï½ï½ï½ãã¨ãã«æ°ã¥ããã¨é常ã«æ¥½ã«ãªãå ´åãããã¾ãã
ãããªããã¯æä½ã®ç°¡ç¥åãã§ããã°å¾ã¯ç°¡å(ABC-Cãããã®é£æ度)ã§ããããã®åé¡ã¨ããã®åé¡ã¨ãã¯ç°¡ç¥åãèããäºãæ¬è³ªãªã®ã§ãã§ããéãæä½ãç°¡åã«ã§ããªããèãã¦ããã¾ãããã
åé¡å 容ããµã³ãã«ãè¦ããããã
ããã¯åç´ãã¤å¹æãå¼·ãæ¹æ³ãªã®ã§ããããµã³ãã«ã®ä¾ãçµµãªãå³ãªãã«æ¸ãèµ·ããã¦ã¿ãã¨é常ã«åããããããªãã¾ãã
ç¹ã«ã°ã©ãåé¡ã¯å
¥åä¾ã ãã ã¨ç解ãã¥ããã®ã§è¿·ã£ããå³ãæ¸ãã¹ããããã大åã
辺æ
å ±ãå
¥åããã¨ã°ã©ããããæãã«å¯è¦åãã¦ããããµã¤ã(generate DOT)ãããã®ã§ããããã®ãµã¤ããæ´»ç¨ããããã¦åé¡ãåãããããæ´çãã¾ãããã
ããè¨ç®éãä½ããããªããªãè´ æ²¢ã«ä½¿ã£ã¦ã¿ã
ãããããã¯æ¬å½ã«å ´åã«ããã®ã§ãããããè¨ç®éã105以ä¸ã®ã³ã¼ããæ¸ãã¦ãã®ãªããã£ã¨è´
æ²¢ã«è¨ç®éã使ã£ãã³ã¼ããæ¸ããæ¹ãããã§ãã
å¶ç´N<=103ã§O(NlogN)ã®ãã£ã¡ãã¤ããå®è£
ã¨O(N2)ã®æ¥½ãªå®è£
ãæãã¤ããã®ãªããO(N2)ã®æ¥½ãªå®è£
ãããæ¹ãããã¨(åã¯)æãã¾ãã
â¦ã§ãN<=2000ã§æ³å®è§£O(1)ã®500ç¹åé¡ããããâ¦ããï¼å ´åã«ãããªï¼
æ°´è²ã«ãªãã¾ã§ã®åå¼·æ³
èªåèªèº«ã®çµé¨ãå
ã«ç²¾é²ããæã®ã³ããããã¤ãæãã¦ã¿ããã¨æãã¾ãã
ã©ããã¦ãåå人ã®èã(åè¦)ãå¼·ãåæ ããããã®ã«ãªã£ã¦ãã¾ãã¾ããåèã¾ã§ã«â¦
ã¨ããããéå»å(300~400)ãçã£ç«¯ããåãã
AtCoder ProblemsãAtCoder Scoresãè¦ãªããåãã¦è¡ãã°ããã®ã§ããããããä¼¼ãå¾åã®åé¡ãéã£ã¦ããæã«å½¹ç«ã¡ã¾ãã
ã¨ãããããããã£ã¦ããã°ããæãã(å°å£°)
è¦æåéã®åé¡ãæ¢ãã¦è§£ã
ããããã¡ãã大åãå¶ç¶CãDãè¦æåéã§2å®ããã§ããªãã£ãã¿ãããªäºãããã°äººççµäºã§ãããâ¦
dijkstra-webãhttps://koki-yamaguchi.github.io/ãªã©ã®ãµã¤ãã使ãã°ã¸ã£ã³ã«ãã¨ã®åé¡çµãè¾¼ã¿ãå¯è½ãªã®ã§ããããã使ã£ã¦ããæãã«è§£ãã¦ããã¨å¯¾å¿ã§ããåé¡ãåºãã£ã¦é常ã«ããã¨æãã¾ãã
è»æ¬ãä¸ç´ç·¨è¾ºãã¾ã§æµãèªã¿ãã
ããé常ã«å¹æãã£ã¦ããããã§ãããã¾ãç解ããªãã¦ãããã®ã§æµãèªã¿ãã¦ãã³ã³ãã¹ãä¸ã«ãããè»æ¬ã§è¦ãæ°ãããï¼ãã£ã¦ãªãã°å¾ã¯è»æ¬åçµã§ACãã¨ãããã¨ããªãã£ãããã¾ãã
ããã£ããã
AtCoder Virtual Contestã使ãã¨AtCoderã®éå»åã使ã£ããã¼ãã£ã«ã³ã³ãã¹ããéå¬ã§ãã¾ãã
ä»ã®äººãç«ã¦ãããã£ã«åå ãããªãèªåã§ããã£ãç«ã¦ããªããæ®æ®µããéä¸ããç°å¢ã§åé¡ã«åãçµããã®ã§é常ã«ããã§ãã
æµ·å¤ã³ã³ã«åºã
ã¦ã£ã¨ãæ©ãæ°´è²ã«ãªããããªããã©ãµããCSAã§2å®ã§ããã°ããæ°´è²ã«ãªããã®ã§â¦(æ®´)
ã¾ããæµ·å¤ã³ã³ã¯éä¸ãã¦åé¡ã解ãããæã®ç·´ç¿ãã¬ã¼ããåæ»ãã¦ããã¨æããæã®æ°å転æã«å®éããã§ãã
è¨èªã®å£ãGoogle翻訳ã«ä¸¸æãããã°è§£æ±ºã§ããã®ã§ãçããæµ·å¤ã³ã³ã«åºã¾ããã(åºã¾ããã)ã
åé¡é
ãã®ãã¼ã¸ã§ä¾ã«æããåé¡ã¨ãABC-Cã¾ãã¯ABC-Dã®åé¡ã§(å人çã«)ãã£ã¦ããã¹ãã ã¨æããåé¡ãããã¤ãè²¼ã£ã¦ããã¾ããã©ããè¯ãåé¡ãªã®ã§ãã²è§£ãã¦ã¿ã¾ããã(解ãã¾ããã)ã
ABC006-C ã¹ãã£ã³ã¯ã¹ã®ãªããªã
ABC040-C æ±æ±æ±æ±æ±
ABC054-C One-Stroke Path
ABC070-C Multiple Clocks
ABC075-C Bridge
ABC085-C Otoshidama
ABC090-D Remainder Reminder
ABC055-D Menagerie
ABC059-D Alice&Brown
ABC067-D Fennec VS. Snuke
ABC073-D joisino's travel
ABC078-D ABS
ABC085-D Katana Thrower
ABC088-D Grid Repainting