å€ã®éšå±ã æéã®äžã§äœåãã®ç¥ç§çãªé¡ããã¢ãã¿ãŒã®éã¿ããã£ãèŒãã«ç §ããããŠããŸãã 100äžåã®ããŒã®è³éããªããããé³ã EnterããŒã§æ©æ¢°ã®ãããªãã³ããæŒããŸãã æ°åäžå¹ã®ããºãã®äžåãªé³Žã声âŠã ããã確ãã«ãè² è·ã®é«ãã·ã¹ãã ã®ãã¹ãŠã®éçºè ã®æ³ååãçºæ®ãããŸããã ãããŠãããªãã圌ãæéå ã«æ¢ããªããã°ãã¹ãªã©ãŒæ ç»ããã©ãŒæ ç»å šäœãåºãŠãããããããŸããã ãããããã®èšäºã§ã¯å°é¢ã«ãã£ãšè¿ã¥ããŸãã æ€çŽ¢ãã³ãã®åé¡ã解決ããããã®ããç¥ãããã¢ãããŒããããããå šæã«ããæ¹æ³ãåŠãã æ¹æ³ãç°¡åã«ã¬ãã¥ãŒãããŸããããã«ã¹ããŒããäžããããã«è¡ã£ãããã€ãã®ããªãã¯ã«ã€ããŠè©±ããŸãããåæã«ãªãœãŒã¹ãžã®æ¬²ãæããŸããã èšäºã®æåŸã§ãããŒãã¹ãããªããåŸ ã£ãŠããŸã-å°ããªå®äŸã§ãã
ãããŒãã®äžãã«ããã¹ããã®ã¯äœã§ããïŒ
- ããã³ããã®æ€çŽ¢ã¯å
šæã§ããå¿
èŠããããŸããã€ãŸããããã³ããããã¹ãå
ã®ä»»æã®é åºã§ãŠãŒã¶ãŒã¯ãšãªãããã¹ãŠã®åèªãæ€çŽ¢ã§ããå¿
èŠããããŸãã ããšãã°ããŠãŒã¶ãŒãã¯ãšãªãwatchããå
¥åããå ŽåãããŒã¿ããŒã¹ã«ã¯æ¬¡ã®ããã³ããã衚瀺ãããŸãã
ããŠã©ããããšããåèªããããã®ããã³ããã®ç°ãªãå Žæã«ããã«ããããããããŠãŒã¶ãŒã¯3ã€ãã¹ãŠãèŠãå¿ èŠããããŸãã - ãŠãŒã¶ãŒã®èŠæ±ã¯ãããŒããŒãã§å ¥åäžã«å®äºããªãå ŽåããããŸãã ãããã£ãŠãåèªã§ã¯ãªãæ¥é èŸã§æ€çŽ¢ããå¿ èŠããããŸãã åã®äŸã§ã¯ãããŠã©ããããšããåèªå šäœã ãã§ãªãããã®ãã¬ãã£ãã¯ã¹éšåã«ã€ããŠã3ã€ã®ãã³ãããã¹ãŠè¡šç€ºãããŸãã ããšãã°ãã watch ãã
- Search Mail.Ruã¯æ±çšã®æ€çŽ¢ãšã³ãžã³ã§ããã€ãŸããå¯èœãªã¯ãšãªã®çš®é¡ã¯å€ããã·ã¹ãã ã¯æ°åäžã®ãã³ãã®äžããæ€çŽ¢ã§ããã¯ãã§ãã
- åå¿ã®é床ã¯éåžžã«éèŠãªã®ã§ãæ°ããªç§ã§çããåºããããšæããŸãã
- æåŸã«ããµãŒãã¹ã¯24æé365æ¥çšŒåããä¿¡é Œæ§ã®é«ãã·ã¹ãã ã§ãªããã°ãªããŸããã ãã·ã¢å šåããã³CISè«žåœããã®ãã³ãã¯ãæ¯ç§æ°åã®ãªã¯ãšã¹ããåŠçããŸãã ãã©ãŒã«ããã¬ã©ã³ã¹ã®ããã«ããããã£ãŠãå®è£ ãšãããã°ã容æã«ããããã«ãéåžžã«ã·ã³ãã«ã§ãšã¬ã¬ã³ããªç¹å®ã®ã¢ã€ãã¢ããµãŒãã¹ã®äžå¿ã«æã€ããšãéåžžã«æãŸããã§ãã
æ¢ç¥ã®ã¢ãããŒã
1.ãã¬ãã£ãã¯ã¹ã®èªåè£å®
aã éã¿ä»ãã®ãã³ãïŒéã¿==人æ°ïŒã¯ããã³ãã«åŸã£ãŠèŸæžé ã«ãœãŒããããŸãã
bã ãŠãŒã¶ãŒãã¯ãšãªïŒãã¬ãã£ãã¯ã¹ïŒãå ¥åãããšããã€ããªæ€çŽ¢ã§ãã³ãã®ãµãã»ãããæ€çŽ¢ããããã®å é ããã®ãã¬ãã£ãã¯ã¹ãæºãããŸãã
cã èŠã€ãã£ããµãã»ããã¯éã¿ã®éé ã§ãœãŒããããçµæãšããŠãæãéãããã³ãã®ãããããŠãŒã¶ãŒã«æäŸãããŸãã
ãã®ã¢ãããŒãã®æãããªæé©åã¯ã ããªãŒã®ããŒãã«éã¿ãæã€ãããªã·ã¢ããªãŒã§ãã æããéããã¯ãšãªãéžæããå ŽåãååãšããŠã åªå 床ãã¥ãŒ ããŸãã¯å¯Ÿæ°æ€çŽ¢æéãæäŸããã»ã°ã¡ã³ãããªãŒ ã䜿çšãããŸã ã å¿ èŠã«å¿ããŠã RMQã¢ã«ãŽãªãºã ãä»ããŠLCAã䜿çšããŠãµãŒããŒã®ã¡ã¢ãªãæ¶è²»ããããšãã§ããŸãããããããšã éåžžã«è¿ éãªãã¬ãã£ãã¯ã¹ãã³ããåŸãããŸãã ãã®ã¢ãããŒãã«ã¯ãé床ãã³ã³ãã¯ãããå®è£ ã®å®¹æãã®3ã€ã®å©ç¹ããããŸãã ãã ããæçœã§æãäžå¿«ãªæ¬ ç¹ã¯ãããã³ããã®ããã¹ãå ã®åèªã®é åãæ€çŽ¢ã§ããªãããšã§ãã ã€ãŸãããã®ãããªããã³ããã¯ãã¬ãã£ãã¯ã¹ã®ã¿ã§ããããã«ããã¹ãã§ã¯ãããŸããã
2.å šæèªåè£å®
aã ãã«ãããã¹ããšãŠãŒã¶ãŒãªã¯ãšã¹ãã¯äžé£ã®åèªãšèŠãªãããŸãã
bã ãŠãŒã¶ãŒãã¯ãšãªãå ¥åãããšãããŒã¿ããŒã¹ã¯ãããã³ããå ã®äœçœ®ã«é¢ä¿ãªãããŠãŒã¶ãŒã®ãã¹ãŠã®åèªïŒãŸãã¯ãã¬ãã£ãã¯ã¹ïŒãå«ãããã³ããã®ãµãã»ãããæ€çŽ¢ããŸãã
cã èŠã€ãã£ããµãã»ããã¯ããã³ãã¯ãŒãã®éé ã§ã¯ãšãªã¯ãŒãã«ãœãŒãããã次ã«éã¿ã®éé ã§ãœãŒãããããæãéãããã®ã®TOPããŠãŒã¶ãŒã«è¿ãããŸãã
å®éãããã¯ãã«ããã¹ãã¢ãããŒãã§ãããããã«ã€ããŠã¯ããã«èª¬æããŸãã ãã®ããŒãã«é¢ããŠã¯ãåœå å€ã®èè ã«ããèšå€§ãªæ°ã®åºçç©ãã€ã³ã¿ãŒãããã§å ¥æã§ããŸãã äŸïŒ
- ãã¡ãžãŒæ€çŽ¢ã®å®è£ -èè ã¯ã誀åèšæ£ãšçµã¿åãããŠãããŒãã¬ã¹ãã©ã³ããã®ä»ã®æœèšã®ååã®æ€çŽ¢ãã³ããå®è£ ããŸããã ãã³ãã¯çŽ2.5ååãããªãã£ããããã¯ãŒããã¬ãã£ãã¯ã¹ã«ããæ€çŽ¢çšã«å€æŽãããWagner-Fisherã¢ã«ãŽãªãºã ã䜿çšããŠããã¹ãŠã®ãã³ãã§æ€çŽ¢ããã®ã«ååã§ããããšãå€æããŸããã ãã®æ¹æ³ã¯é«å質ã§ãããé床ãé ãããã«é©ããŠããŸããã
- TASTIERã¢ãããŒã -èšäºã®ã©ã€ãæ€çŽ¢ã¯ãå®å šã«äžèŽããã ãã§ãªããé¢é£ããåºçç©ãæ€çŽ¢ããŸãã ãŠãŒã¶ãŒã®ã³ã³ããã¹ããRAMã«ä¿åãããŠãŒã¶ãŒã®èŠæ±ã«å¿ããŠé©å¿ã§ããããã«ããŸããããã¯ãã¡ã¢ãªãéåžžã«é«äŸ¡ã§ãé床ã«æªåœ±é¿ãåãŒããŸãã
- Sphinxã·ã³ãã«ãªãªãŒãã³ã³ããªãŒããšä¿®æ£ã®ææ¡ -æåãªãªãŒãã³æ€çŽ¢ãšã³ãžã³Sphinxã«åºã¥ããªãŒãã³ã³ããªãŒãã èªåè£å®ã®åºæ¬çãªèãæ¹ã¯ãMySQLã¯ãšãªèšèªã§ã®ã¯ã€ã«ãã«ãŒãã®äœ¿çšã§ãïŒâ the wor * âã ã¿ã€ããã¹è£æ£-n-gramã¢ãããŒãã«åºã¥ããŠããŸãã ãã¡ããããã®ãããªæ€çŽ¢ã¯ç§ãã¡ãå¿ èŠãšãããã®ã§ã¯ãããŸãããçµå±ããŠãŒã¶ãŒã¯å¿ ãããæåŸã®åèªãå ¥åãããšã¯éããŸããã ãããŠãå®è·µã瀺ãããã«ããŠãŒã¶ãŒã¯ã¯ãšãªèªã奜ããªããã«ãä»»æã®é åºã§å ¥åã§ããŸãã ããã«ãn-gramã¢ãããŒãã§ã¯ããªã¢ã«ã¿ã€ã ããã³ããã«é©çšããããã«å€ãã®ãªãœãŒã¹ãå¿ èŠã«ãªããŸãã
ããã§èæ ®ãããŠããªãäžèšããã³ãã®ä»ã®ã¢ãããŒãã¯ãåçæ§+é床+ã·ã³ãã«ãã®çµã¿åããã§ã¯æºè¶³ã§ããŸããã§ããã ãã®ãããããŒãºãæºããç¬èªã®ã¢ã«ãŽãªãºã ãéçºããŸããã
åé¡ã®æ£åŒãªå£°æ
ã¢ã«ãŽãªãºã ã説æããåã«ãåé¡ãããæ£åŒãªæ¹æ³ã§å®åŒåããŸãã ã ãããäžããããïŒ
- ãã³ãããã¹ãã®ã»ããS = {s 1 ãs 2 ã...ãs N }ãåã¯ãŒãã¯ãåèªWïŒs i ïŒ= {w i1 ãw i2 ã...ãw iK }ã§æ§æãããŸãã ãŠãŒã¶ãŒãæ€çŽ¢ãšã³ãžã³ã«åãåãããã¯ãšãªãã°ããååŸãããã«ãããã¹ãã
- ãã³ãã®äººæ°ã®éã¿ã®ã»ããF = {f 1 ãf 2 ã...ãf N }ã ããã§ã®äººæ°ãšã¯ãç¹å®ã®ãªã¯ãšã¹ãã®äœ¿çšé »åºŠãã€ãŸãããŠãŒã¶ãŒãç¹å®ã®ãªã¯ãšã¹ãã«å¯ŸããŠæ€çŽ¢ãšã³ãžã³ã§äœããæ€çŽ¢ããé »åºŠãæå³ããŸãã
- ãã¬ãã£ãã¯ã¹Q = {p 1 ãp 2 ã...ãp M }ã®é åºä»ããããã·ãŒã±ã³ã¹ã§æ§æãããäžå®å šãªãŠãŒã¶ãŒèŠæ±ã åè¿°ã®ããã«ããªã¯ãšã¹ãã¯äžå®å šãªå ŽåãããããããŠãŒã¶ãŒã®ãªã¯ãšã¹ãã¯äžé£ã®ãã¬ãã£ãã¯ã¹ãšèŠãªãããŸãã
å¿ é ã§ãïŒ
- Sããã®ãã¹ãŠã®ãã³ãs iã®ã»ããRãèŠã€ããŠãQããã®åæ¥é èŸp j ã«å¯Ÿã㊠ãWããã®1ã€ã®äžæã®åèªw k ïŒs i ïŒã«å¯Ÿå¿ããŸãã
- 2ã€ã®åºæºã«åŸã£ãŠãèŠã€ãã£ããã³ãã®ã»ããRããœãŒãããŸãã
- WïŒs i ïŒã®èªé w kã®éé ããŠãŒã¶ãŒã¯ãšãªQã®æ¥é èŸp i
- Fããã®äººæ°éã¿f lã®éé Rããã®s i
玢åŒ
ãã³ãã«ããå šææ€çŽ¢ãå¿ èŠãªãããã€ã³ããã¯ã¹ã®åºç€ã¯ãäžè¬çãªå šææ€çŽ¢ã®å®è£ ãžã®å€å žçãªã¢ãããŒãã§ãããææ°ã®Webæ€çŽ¢ãšã³ãžã³ã¯ããã«åºã¥ããŠããŸãã å šææ€çŽ¢ã¯éåžžãããããããã¥ã¡ã³ãéã§å®è¡ãããŸããã€ãŸãããŠãŒã¶ãŒã®ãªã¯ãšã¹ãããåèªãæ€çŽ¢ããããã¹ãã§ãã ã¢ã«ãŽãªãºã ã®æ¬è³ªã¯ããã©ã¯ãŒãã€ã³ããã¯ã¹ãšãªããŒã¹ã€ã³ããã¯ã¹ã®2ã€ã®åçŽãªããŒã¿æ§é ã«çž®å°ãããŸãã
- çŽæ¥ã€ã³ããã¯ã¹ -ãã®ããã¥ã¡ã³ãããã®IDã§æ€çŽ¢ã§ããããã¥ã¡ã³ãã®ãªã¹ãã ã€ãŸããçŽæ¥ã€ã³ããã¯ã¹ã¯æååã®é
åïŒããã¥ã¡ã³ãã®ãã¯ãã«ïŒã§ãããããã¥ã¡ã³ãã®IDã¯ã€ã³ããã¯ã¹ã§ãã
- éçŽ¢åŒ -ãã¹ãŠã®ææžãããäžå·ãããåèªã®ãªã¹ãã ååèªã«ã¯ããã®åèªãåºçŸãããœãŒãæžã¿IDããã¥ã¡ã³ãã®ãªã¹ãïŒæçš¿ãªã¹ãïŒãå²ãåœãŠãããŸãã
ããã2ã€ã®ããŒã¿æ§é ã䜿çšãããšããŠãŒã¶ãŒã®èŠæ±ãæºãããã¹ãŠã®ããã¥ã¡ã³ããç°¡åã«èŠã€ããããšãã§ããŸãã ãããè¡ãã«ã¯ã次ã®ãã®ãå¿ èŠã§ãã
- éã€ã³ããã¯ã¹ïŒã¯ãšãªã®åèªã«åŸã£ãŠããããã®åèªãèŠã€ãã£ãããã¥ã¡ã³ãã®IDãªã¹ããèŠã€ããŸãã ãããã®ãªã¹ãã®å ±ééšåã¯ãã¯ãšãªããã®ãã¹ãŠã®åèªãèŠã€ãã£ãidããã¥ã¡ã³ãã®çµæãªã¹ãã§ãã
- çŽæ¥ã€ã³ããã¯ã¹ïŒåä¿¡ããIDã§ãœãŒã¹ããã¥ã¡ã³ããèŠã€ãããŠãŒã¶ãŒã«ãæž¡ããŸããã
ãã®èšäºã§ã¯èª¬æãååã§ãããããæ€çŽ¢ã®è©³çŽ°ã«ã€ããŠã¯ãã¹ã¿ã³ãã©ãŒã倧åŠã®æ¬ã æ å ±æ€çŽ¢ã®æŠèŠ ãã«éããŸãã
å€å žçãªã¢ã«ãŽãªãºã ã¯åçŽã§åªããŠããŸãããã¯ãšãªã®åèªã¯äžè¬ã«ãæªå®æãã§ãããããçŽç²ãªåœ¢åŒã§ã¯ãã³ãã«ã¯é©çšãããŸããã ãŸãã¯ãäžã§è¿°ã¹ãããã«ããªã¯ãšã¹ãã¯åèªã§ã¯ãªããã¬ãã£ãã¯ã¹ã§æ§æãããŸãã ãã®åé¡ã解決ããããã«ãéã€ã³ããã¯ã¹ãå®æãããŸããããããåŸããããã®ã§ãã
泚 ïŒä»¥äžã®å³ã§ã¯ãç°¡æœã«ããããã«ãããªãŒã®ããã€ãã®ããŒããè€æ°ã®æåã®1ã€ã®é·ç§»ã«ãããŒãžããããŠããŸãã
äŸã䜿çšããŠã€ã³ããã¯ã¹æ€çŽ¢ãåæããŸãããã
- äžèšã®ã€ã³ããã¯ã¹ãèªç±ã«äœ¿çšã§ãããŠãŒã¶ãŒããã§ã«ãªã¯ãšã¹ãã®äžéšãå ¥åããŠãããšããŸãã 次ã®æåãããŒããŒãã«å ¥åãããŸããããäžå®å šãªãªã¯ãšã¹ãã omnââia v ããåãåããŸããã
- ã¯ãšãªããã¬ãã£ãã¯ã¹ã¯ãŒãã«åå²ããŸããã omnââia ããšã v ããååŸããŸãã
- æ€çŽ¢ãšã³ãžã³ãšã®é¡æšã«ãããæåã«ãäžããããæ¥é èªãäžãããããšãéã€ã³ããã¯ã¹ã§id idãªã¹ããèŠã€ããŸãã éã€ã³ããã¯ã¹ã¯2ã€ã®éšåã§æ§æãããŠããããšã«æ³šæããŠãã ããã
aã ããã³ããã®ããã¹ããããåæãããåèªãå«ããã¬ãã£ãã¯ã¹ããªãŒ ïŒããã©ã€ãããããã³ãïŒã
bã ããŒã«ãããIDã®ãªã¹ã-çŽæ¥ã€ã³ããã¯ã¹å ã®ããŒã«ãããããã¹ãã®ã€ã³ããã¯ã¹ãããã«ã€ããŠã¯ä»¥äžã§èª¬æããŸãã ãªã¹ãã¯idã®æé ã§ãœãŒããããåèªãçµããé ç¹ã«é 眮ãããŸãã
ç§ã¯ãã©ã€ãç§ãã¡ã«ãšã£ãŠ2ã€ã®çç±ã§è¯ããšèšããªããã°ãªããŸããïŒ
- æéOïŒlogïŒnïŒïŒã§ä»»æã®åèªæ¥é èŸãèŠã€ããããã«äœ¿çšã§ããŸããããã§ã nã¯æ¥é èŸã®é·ãã§ãã
- ç¹å®ã®ãã¬ãã£ãã¯ã¹ã«ã€ããŠããã®ç¶ç¶ã®ãã¹ãŠã®ãªãã·ã§ã³ãç°¡åã«æ±ºå®ã§ããŸãã
ãã®ãããåæ¥é èŸã«ã€ããŠãããªãŒãäžã£ãŠè¡ããäžéããŒãã§èªåèªèº«ãèŠã€ããŸãã 次ã«ã æ£ãã ID IDãªã¹ããååŸããå¿ èŠããããŸãã - ãã¹ãŠã®åããŒãã®ãªã¹ããããŒãžããŸãã äœã®ããã«ïŒ éåžžã®æ€çŽ¢ãšã³ãžã³ãšåæ§ã«ãåãã¬ãã£ãã¯ã¹ã®IDãªã¹ãã暪æããå¿
èŠããããŸããã2ã€ã®ãBUTãããããŸãã
aã ãŸãããã¹ãŠã®ããŒãã«idãã³ãã®ãªã¹ããå«ãŸããŠããããã§ã¯ãªããåèªå šäœãããŠã³ããŒããããããŒãã®ã¿ãå«ãŸããŠããŸãã
bã 第äºã«ãèããŒããé€ããåããªãŒããŒãã«ã¯ç¹å®ã®ç¶ç¶ããããŸãã ã€ãŸãã1ã€ã®ãã¬ãã£ãã¯ã¹ã«å¯ŸããŠéåžžã«å€ãã®æ¡åŒµåãååšããå¯èœæ§ãããããããã®æ¡åŒµåãèæ ®ããå¿ èŠããããŸãã
ãããã£ãŠãæå¶ãèŠã€ããåã«ãåã ã®ãã¬ãã£ãã¯ã¹ããšã«IDãã³ãã®ãªã¹ãããåèšãããå¿ èŠããããŸãã ãããã£ãŠãåæ¥é èŸã«ã€ããŠããã®æ¥é èŸã«åŸã£ãŠããªãŒå ã§åæ¢ããããŒãããéå§ããŠãããªãŒãååž°çã«æ·±ãå·¡åããããŒãžã¢ã«ãŽãªãºã ã«ãã£ãŠãã®åããŒãã®ãã¹ãŠã®ãªã¹ãã®çµåãæ§ç¯ããŸãã ãã®å³ã§ã¯ããã¬ãã£ãã¯ã¹ã§åæ¢ããããŒãã«ã¯èµ€ãäžžãä»ãããã ããŒãžæäœã«ã¯ ã U ã ãä»ããããŠããŸãã - 次ã«ãåãã¬ãã£ãã¯ã¹ã®åæãŠããªã³ãªã¹ãã暪æããŸãã ãœãŒãããããªã¹ãã暪æããããã®ããŸããŸãªã¢ã«ãŽãªãºã ã¯åãªãæµ·ã§ããããããããç°ãªãã¿ã€ãã®ã·ãŒã±ã³ã¹ã«ããé©ããŠãããšèšããªããã°ãªããŸããã æãå¹æçãªãã®ã®1ã€ã¯ãRicardo Baez-Yatesããã³Alejandro Salingerã¢ã«ãŽãªãºã ã§ãã æŠéã®ãã³ãã§ã¯ãç¹å®ã®ã¿ã¹ã¯ã解決ããã®ã«æé©ãªç¬èªã®ã¢ã«ãŽãªãºã ã䜿çšããŸãããBaez-Yates-Salingerã¢ã«ãŽãªãºã ã¯ãã€ãŠç§ãã¡ã«ã€ã³ã¹ãã¬ãŒã·ã§ã³ãäžããŸããã
- èŠã€ãã£ãIDã«ãã£ãŠããã³ãããã¹ããæ¢ããŠããŸãã ãã®å Žåã®çŽæ¥ã€ã³ããã¯ã¹ã¯ãæ€çŽ¢ãšã³ãžã³ã®çŽæ¥ã€ã³ããã¯ã¹ãšåãã§ããã€ãŸããæååã®åçŽãªé åïŒãã¯ãã«ïŒã§ãã ãã«ãããã¹ãã«å ããŠãè¿œå æ å ±ãå«ããããšãã§ããŸãã ç¹ã«ãããã§ã¯äººæ°ã®éã¿ãä¿åããŸãã
ãã®ããã6çªç®ã®ã¹ããŒãžã®çµãããŸã§ã«ããŠãŒã¶ãŒãªã¯ãšã¹ãããã®ãã¹ãŠã®ãã¬ãã£ãã¯ã¹ããããã¹ãŠã®ãã³ããæ¢ã«ãããŸãã æããã«ããã®æ®µéã§åŸããããã³ãã®æ°ã¯éåžžã«å€ããæ°åããæ°åäžã«åã¶å ŽåãããããŠãŒã¶ãŒã«ãããã³ããããåºãããã«å¿ èŠãªã®ã¯æé«ã®ãã®ã ãã§ãã ãã®åé¡ã¯ãå¥ã®ã¢ã«ãŽãªãºã ã§ããã©ã³ãã³ã°ã¢ã«ãŽãªãºã ã«ãã£ãŠè§£æ±ºãããŸãã
次ã«ã絶察ã«äœãããã«ããã³ãââãããååãã©ã³ã¯ä»ãã§ããããã«ãã1ã€ã®å°ããªããªãã¯ãèŠãŠãããŸãã ãããŠã2ã€ã®åé¡ãæ€èšããéçšã§ãããã«ã€ããŠä»¥äžã§èª¬æããŸãã
ã¹ããŒãã¢ãã
ãææå°æ©ã®æé©åã¯ãã¹ãŠã®æªã®æ ¹æºã§ãã-ããã«ãã»ã¯ããŒãã«ãã£ãŠçå®ããã人æ°ã®ããããã°ã©ãã³ã°ã®ç¥æµã¯è¿°ã¹ãŠããŸãã ããããäžèšã®ã¢ã«ãŽãªãºã ãçŽç²ãªåœ¢ã§å®è£ ãããšã2ã€ã®ããã©ãŒãã³ã¹ã®åé¡ãçºçããŸãã ãããã£ãŠãç§ãã¡ã«ãšã£ãŠãã¹ããŒããæ±ããéäºã®æ¬ åŠã¯ããã«æªãããšã§ãã
æåã®åé¡ã¯ããªã¹ãã®ããŒãžãé ãããšã§ã ã ãã®åé¡ãããã«è©³ããèããŠã¿ãŸãããã
- ç§ãã¡ã®ããªãŒïŒãã¬ã€ïŒã«ã¯ãæåã a ãã§å§ãŸã1000åã®åèªãæ¢ã«ååšãããšããŸãïŒå®éã«ã¯ãããã«å€ãã®åèªãååšããŸãïŒã
- æããã«ã1000ã¯ãŒãã®å Žåãidãã³ãã®æå°å¹³åæ°ãçŽ1000ã§ããã€ãŸããå¹³åããŠãæåãaãã§å§ãŸãã¯ãŒããããæäœ1000ã®ãã³ãããããŸãã
- ããã§ããŠãŒã¶ãŒããã®æåã a ãã§äœããæ€çŽ¢ããããšã«ãããšæ³åããŠãã ããã ã¢ã«ãŽãªãºã ã«ããã°ããã¬ãã£ãã¯ã¹ãaãã«å¯ŸããŠãããŒããaãã®äžã«ãããã¹ãŠã®åããŒãã®ãªã¹ããçµåããæäœãéå§ãããŸãã åœç¶ããã®æäœã«ã¯é©åãªãªãœãŒã¹ãå¿ èŠã§ãããŸããæ°ãããªã¹ãã«ã¡ã¢ãªãå²ãåœãŠã次ã«ããã®æ°ãããªã¹ãã«idãã³ããŒããŸãã
çµåã¯ã2ã€ã®ããªãã¯ã䜿çšããŠæé©åã§ããŸãã
- æ°ããèŠæ±ããšã«ã¡ã¢ãªãå²ãåœãŠãªãããã«ãæçµãªã¹ãçšã«ã¡ã¢ãªãäºçŽããŸãã
- ãæ lazãªãæ¹æ³ã§ãã€ãŸãå¿ èŠã«å¿ããŠå£çµããã
ããããç§ãã¡ã®å®éšã§ã¯ããŠããªã³ã䜿çšããããªãã¯ã¯ãã£ãã·ã³ã°ã®ããã«æé©åãšæ¯èŒã§ããªãããšã瀺ãããŸããã ã¯ããã¯ãããªãŒããããã ãã§ãªããããªãŒã®åããŒãã«ãã³ãã®IDãè¿œå ãå§ããŸããã åèšïŒããŒãžããå¿ èŠã¯ãããŸãã-åå¯èœãªãã¬ãã£ãã¯ã¹ã®æ¢è£œãªã¹ãã¯ããªãŒããŒãã«çŽæ¥ãããŸãã ãããŠãéã€ã³ããã¯ã¹ã®åœ¢åŒã¯æ¬¡ã®ãšããã§ãã
ããããåŸ ã£ãŠãã ããïŒ ããªãŒã®åããŒãã«idã®ãã³ããå ¥ããŸããïŒïŒ ãšãŠãç¡é§ã«èŠããŸãããïŒ ããããããã¯ãšãŠãç¡é§ã§ããïŒ æšè«ïŒ
- æ°ãããã³ãããšã«ãããã¹ãã«å«ãŸããæåæ°ãšåãæ°ã®idãè¿œå ããå¿
èŠããããŸãã ããã¯ææªã®å Žåã®ã·ããªãªã§ããidã¯ã¹ããŒã¹ãšç¹°ãè¿ãåèªïŒãããŸã®ããŒãããšãã¹ãŠ
ã§ããïŒã«ã¯å¿ èŠãªããããidã®è¿œå ãå¿ èŠãããŸããã - ããšãã°ãå¹³åãã³ãé·ã25æåã®å Žåã100äžä»¶ã®æ€çŽ¢ãã³ãã«ã¯2500äžæåãå«ãŸããŸãã ãŸãããã³ãIDã4ãã€ãæŽæ°ïŒæšæºintïŒã®å Žåãææªã®å Žåãéã€ã³ããã¯ã¹å ã®ãã¹ãŠã®ãã³ãIDãªã¹ããã¡ã¢ãªã§å æããŸãïŒ 4ãã€ã* 25,000,000 = 100 MB ã ãããŠããã®ãããªããªã¥ãŒã ã¯ãæããã«ãæ®éã®personalkaã«ãšã£ãŠãããããã»ã©ç¡é§ã§ã¯ãããŸããã æ¯äŸããŠã5000äžã®ãã³ãã«å¯ŸããŠãã€ã³ããã¯ã¹ã¯5 GBãå æããŸããããã¯ãæ¬æ Œçãªæ€çŽ¢ãã³ãã®ãµãŒãã¹ã«éåžžã«é©ããŠããŸãã
ããã§ãå¯èœãªãã¬ãã£ãã¯ã¹ããšã«ãã¹ãŠã®ãªã¹ãããã£ãã·ã¥ããããšã§ããªã¹ããçµåããåé¡ã解決ããŸããã
2çªç®ã®åé¡ã¯ããªã¹ãã®äº€å·®ãé ãããšãšãééã«ãããããã®ã©ã³ãã³ã°ïŒãœãŒãïŒã§ã ã ã¢ã«ãŽãªãºã ã«ãããšãçµååŸã2ã€ã®éèŠãªã¹ããããç¶ããããããã«ããã©ãŒãã³ã¹ã®åé¡ããããŸãã
- çµåãªã¹ãã®äº€å·®ã 倧èŠæš¡ãªããŒã¿ããŒã¹ã§ã¯ãç¹ã«çããã¬ãã£ãã¯ã¹ã®å Žåãå®éã®ãªã¹ãã¯é·ãããŸãã ãããã£ãŠãã a b ãã®ãããªçãã¯ãšãªã®ã¯ãã¹ãªã¹ãã¯é·ãããŸãã
- ãŸããééã®éé ã§ã®ã©ã³ãã³ã°ã®ãã³ãã 亀差ç¹åŸã®æçµãªã¹ããéåžžã«å€§ãããªãå¯èœæ§ããããããã¯ãšãªã a b ãã®ããã«æ°åã®idããœãŒãããããšãæ¡ç®ãåããŸããã
çµæãåŸãããã«å¿ èŠãªã®ã¯7ã10åã®ãæè¯ã®ããã³ãã ãã§ããããšãæãåºããŠã2ã€ã®ãã€ã³ãã§æ§æãããéåžžã«ç°¡åãªãœãªã¥ãŒã·ã§ã³ãèŠã€ããŸããã
- IDãã³ãã®æ£ããé åºã IDãªã¹ããã³ã³ãã€ã«ããŠããŠã§ã€ããæ倧ã®ããŒã«ãããã®IDãæå°ã«ãªãããã«ããŸãã ã€ãŸãããã³ãã¯éã¿ã®éé ã§ã€ã³ããã¯ã¹ã«è¿œå ããå¿ èŠããããŸãã ãããã£ãŠã亀差ç¹ã®çµæã®ãªã¹ãã¯ãéã¿ãšIDå€ãæžããããšã§æ¢ã«åæã«ãœãŒããããŸãã ãã®ã¢ãããŒããã äºåã©ã³ãã³ã° ããšåŒã³ãŸãã
- å®å
šãªäº€å·®ç¹ã¯å¿
èŠãããŸããã çµéšçã«ç¢ºç«ãããŸããïŒäº€å·®ç¹ã§ã¯ãã¹ãŠãåãããšã¯ã§ããŸããããæåã®Kåã®ãããïŒK> Nã§ããããããã®ç®æšæ°Nã«æ¯äŸããïŒãåãã ãã§ååã§ããããããã®äžã«ã¯ãã§ã«ééã«ãã£ãŠé©åãªãã®ãéžæã§ãããã®ããããŸãåèªé ã§ã ããšãã°ãTOP N = 10ã®æé«ã®ãã³ããå¿
èŠãªå Žåãæåã®K = 100ã«ã€ããŠã®çµæã®äº€å·®ããéžæããå¿
èŠããããŸãããããè¡ãã«ã¯ã亀差ãããšãã«ãçµæãªã¹ãã«ããIDã®æ°ãã«ãŠã³ãããæåã®100ãå
¥åãããšããã«åæ¢ããŸã亀差ç¹ã
ãããã£ãŠãééã«ããã©ã³ãã³ã°ãšãæ âãªãKæåã®ãã³ããžã®äº€å·®ã®äž¡æ¹ãæé©åããŸããã
å®è£
æåã«çŽæããããã«ãèšäºã§èª¬æãããŠããã¢ã«ãŽãªãºã ãå®è£ ããC ++ã®å®çšäŸãæçš¿ããŸãã ãœãŒã¹ããŒã¿ããŒã¹ãšããŠä»»æã®ããã¹ããã¡ã€ã«ã䜿çšã§ããŸããåè¡ã¯ãã³ãã§ãã ããšãã°ã ã©ãã³èª ïŒ source ïŒã®ããšãããç¿Œã®ããè¡šçŸã§ãããåããããšãã§ããŸããããããã°ããã·ã¢èªãžã®ç¿»èš³ããã®éã®ç¿»èš³ããã°ããååŸã§ããŸãã
å®è£ ã®æ©èœã«ã€ããŠã¯èª¬æãããèªè ã«æäŸããŸããå©ç¹ã¯éåžžã«ç°¡åã§ãã
çµè«ã®ä»£ããã«ïŒæ®ããããã®
ãã¡ãããããã§çŽ¹ä»ããã¢ã«ãŽãªãºã ã¯æãäžè¬çãªåœ¢åŒã§èª¬æãããŠãããå€ãã®è³ªåã¯ãã®èšäºã®ç¯å²å€ã§ãã ããŒã«ãããéçºè ãèããã®ã«åœ¹ç«ã€ä»ã®ãã®ã¯äœã§ãããïŒ
- åèªã®äœçœ®ã«åºã¥ããã³ãã©ã³ãã³ã°ã¢ã«ãŽãªãºã ã
- ããŒããŒãã®èšèªã¬ã€ã¢ãŠããéã«ããïŒ "ghbdtn"-> "hello" ;
- ãŠãŒã¶ãŒèŠæ±ã®ã¿ã€ããã¹ã®ä¿®æ£ã ããã§ã¯ãMicrosoftã®éçºè ã«ããåªããèšäºããéãããŸããSãChaudhuriãRãKaushikããšã©ãŒã蚱容ããããã®ãªãŒãã³ã³ããªãŒãã®æ¡åŒµ ã
- æºåãããããã³ããã®ããŒã¿ããŒã¹ããäœãäŒããããšãã§ããªãå Žåã®ã±ãŒã¹ã«å¯ŸãããŠãŒã¶ãŒã®ãªã¯ãšã¹ãã®çµãããèšèšããïŒ ãAlla Pugachevaã¯80幎代åã°ã«äœãæã£ããã
- ãŠãŒã¶ãŒã®å°çãèæ ®ã«å ¥ããïŒ ãæ ç»ã->ãµã©ããã®ãŠãŒã¶ãŒã«ãšã£ãŠã¯ãã¢ã¹ã¯ã¯ãšãµã³ã¯ãããã«ãã«ã¯ã®æ ç»é€šãä¿ã䟡å€ã¯ãããŸããã
- 1åãã2åãã5åã®ãã³ããè¿œå ããŠãã¡ã¢ãªããã³ããã»ããµãªãœãŒã¹ãå®è¡ããå Žåã2ã3ããŸãã¯ãã以äžã®ãµãŒããŒã§ã¢ã«ãŽãªãºã ãã¹ã±ãŒãªã³ã°ããŸãã
- çã ãããã¯ç§ãã¡ã®ææã®ãŠãŒã¶ãŒãšç§ãã¡ã®ããŒãºã«ã®ã¿åããããšãã§ããŸãã
ããã ãã§ã ãæž èŽããããšãããããŸããã
ã¢ã¬ã¯ã»ã€ã»ã¡ãããã§ã¯ã
æ€çŽ¢ãã³ãéçºè ã