2010-05-01ãã1ã¶æéã®è¨äºä¸è¦§
http://projecteuler.net/index.php?section=problems&id=50 unfoldãä½ã£ã¦ã¿ãã
http://projecteuler.net/index.php?section=problems&id=41 é åãéã«åºãã ãã§ãã
http://projecteuler.net/index.php?section=problems&id=294 åºæ¥ãã 22ã®ã¹ãä¹ãããªãã¦11ã®ã¹ãä¹ãªã®ã§ãããããããªããã¨æã£ãããããã§ããªãã£ãããããããªã13secããããã®ã ããããPythonã¯ãã®æã®ãªã¹ãã®è¨ç®ãé ããããã
http://projecteuler.net/index.php?section=problems&id=294 ä½æéçµã£ã¦ããã®ãç¥ããªããããã26人ã解ãã¦ããã ãã¼ããã©ããããã ãããææ¥ã«ããããªã
http://projecteuler.net/index.php?section=problems&id=40 é 延è©ä¾¡ã使ãã¨ç°¡åã§ãã (fun k -> k <= N)ãã®ã©ã ãã¯ãããæ¸ãã¾ãã ((>=) N)ããã¯ã(>=)ã¯2ã¤ã®å¼æ°ãåãé¢æ°ã¨ã¿ãªãã¦ã (>=) N kã§ã N >= kã¨åãã«ãªãã¾ãããããã«ãªã¼åãã¦â¦
http://projecteuler.net/index.php?section=problems&id=49 éè¤çµåããåºããããããã«ã¤ãã¦é åãåºãããã®ä¸ã®2ã¤ãã¤ãåã£ã¦çå·®æ°åãä½ã£ã¦æ¬¡ã®å£ãé åã«ããã調ã¹ã¦ãããã°ããããç´ æ°ã調ã¹ãã
http://projecteuler.net/index.php?section=problems&id=39 é åã使ãã¨ç°¡åã
http://projecteuler.net/index.php?section=problems&id=291 http://d.hatena.ne.jp/inamori/20100518/p1ã®ç¶ããåããããªãã¨ããã£ã¦ããã¯ã¦ãªãã¤ã¢ãªã¼Project Euler 41ãé«éãªç´ æ°å¤å®ã«æ¸ãã¦ãã£ããpow(a, b, c)ã¨ããé¢æ°ã§ab % cãè¨ç®ã§ããâ¦
http://projecteuler.net/index.php?section=problems&id=48 ä¸10æ¡ã ãè¨ç®ããã°ãããã64ãããã§æ¸ããã64ãããå士ã®æãç®ã¯ã§ããªãã®ã§ã5æ¡ãã¤ã«åãã¦è¨ç®ããã
http://projecteuler.net/index.php?section=problems&id=38 nã§å·¦è¾ºç¬¬1é ã®ç¯å²ã決ã¾ãã®ã§ããã¨ã¯pandigitalã«ãªã£ã¦ããããã§ãã¯ããã ãã
ä»è¦ãããæ£çè æ°ã10ä¸ãè¶ ãã¦ããã100027ã ã£ãã
http://projecteuler.net/index.php?section=problems&id=37 2ãã¿ã¼ã³ã¯æ°åãå³ãã追å ãããå·¦ãã追å ããããªã®ã§ãæ°åã追å ããé¢æ°ãããããä½ã£ã¦ããã¾ãã let add_right m d n = m * 10 + d let add_left m d n = m + d * nnã¯mã3æ¡ãªã1000â¦
http://projecteuler.net/index.php?section=problems&id=47 é çªã«ç´ æ°ã®åæ°ãæ±ããã ãã
http://projecteuler.net/index.php?section=problems&id=36 10é²ã®åææ°ãå帰çã«åºãã¦ã2é²ã§åææ°ã«ãªããã調ã¹ã¾ãããã¤ãã©ã¤ã³å¦çã¨ããã®ã使ã£ã¦ã¿ã¾ãããä¾ãã°ãæ°åã®ãªã¹ãããã£ã¦ãªã¹ããéã«ãã¦10é²æ°ã«ããå¦çã¨ããã®ã¯é常ã leâ¦
http://projecteuler.net/index.php?section=problems&id=293 3æéã§ãã§ã«35人ãæ£çãã¦ãããåé¡æé·ããªãããã¡ããç解ããããã¨ã§è²·ãç©è¡ãã¨ãã«èããããèããã¾ã§ããªããããªæ°ãããã åºæ¥ããããã¯è³æ¥µæããã
http://projecteuler.net/index.php?section=problems&id=35 éè¤ãã¦ç´ æ°å¤å®ããããªãã®ã§ãã¾ã代表å ãé¸ãã§ãããå転ãã¦ç´ æ°å¤å®ãããã¨ããã§ããããã«ã¯ãå転ãã¦æå°ã®æ°ã代表å ã«é¸ã¹ã°ããã§ããä¾ãã°ã791ãªã791â917â179ã ããã179ãâ¦
http://projecteuler.net/index.php?section=problems&id=46 ãããä¸è´ããå¤ãæ¢ãããæ¢ãã ããªã®ã§åãã³ã¼ãã使ããªãã£ãã ä¸è´ããªãæåã®å¤ãåºãã®ã§ãdropwhileãä½ã£ãã
http://projecteuler.net/index.php?section=problems&id=34 Problem 30ã¨ã»ã¨ãã©åãã§ãããã¯ãéè¤çµåãã使ãã¾ãã
ãã©ã¼ã»ã©ãã³ç´ æ°å¤å®æ³ï¼Miller-Rabin primarity testï¼ã¯ãã§ã«ãã¼ãã¹ããæ¹è¯ãããã®ãªã®ã§ãã¾ãã¯ãã®èª¬æããã¾ãããã§ã«ãã¼ã®å°å®çã¯ãpãç´ æ°ãaãpã¨äºãã«ç´ ãªèªç¶æ°ã¨ããã¨ã an-1 â¡ 1 (mod p) ãæãç«ã¡ã¾ããä¾ãã°ãp = 7, a = 2ã¨â¦
http://projecteuler.net/index.php?section=problems&id=291 C++ã§Miller-Rabinæ³ãå®è£ ãã¦ã¿ããé¤ç®ã¯doubleã§æ¦ç®ãã¦å¾®èª¿æ´ã¨ããææãã ããã§15åãæåã®æ¹æ³ã§ã¯1åã ãããã©ã¼ã»ã©ãã³æ³ã®ã³ã¼ããããã°ãã»ã¨ãã©ã³ã¼ããæ¸ããã¨ãªãçããâ¦
http://projecteuler.net/index.php?section=problems&id=291Miller-Rabinæ³ãå®è£ ãã¦ã¿ããããã¯ç¢ºççãªç´ æ°å¤å®æ³ã§ãããï¼ãã®ãã¡èª¬æãæ¸ãããï¼ ãã®æ¹æ³ã¨åç´ã«ç´ æ°ã§å²ã£ã¦ããæ¹æ³ã§ã¯ã107ãããã§ã¯åããããªã¹ãã¼ãã ãã1015ã§ã¯2000åâ¦
http://projecteuler.net/index.php?section=problems&id=45 2ã¤ã®iterableãä¸è´ããå¤ãåºãã¯ã©ã¹ãä½ãã å¤è§æ°ãåºãiterableããªããªãæ¸ããªãã£ãã å ´ååããã¦ããã®ã¯ãããããªãã¨ã®ãªã®ãªintã®ç¯å²ã«åã¾ããªããããlong longã«ãã¦ããã°â¦
http://projecteuler.net/index.php?section=problems&id=33 yieldã使ãã¨ç°¡åã§ãã
åå¤å±ã·ãã£ããåå¹´æ¯ãã®ã¬ã¼ã¹ãä»ã¾ã§ä½ããã£ã¦ããã®ã ãããä¼å ´ã«çãã¨ãåä»ã¯ã¹ã¿ã¸ã¢ã ã®å¤ãã¾ãã¯èªå·±ç³åã§ã¡ãã£ã«ã«ãã§ãã¯ãæ¬å½ã¯ããªãã®èª¿åãã¡ãã£ã¨æªãã¦å¯ä¸è¶³ãªã®ã ããã¬ã¼ã¹ã®åå¤ã«ååãªç¡ç ãåãããã¨ãªã©ã¾ããªãã ââ¦
http://projecteuler.net/index.php?section=problems&id=292 ç´ ç´ã«çµãã§ã¿ãããP(30)ããåºãªãã ã°ã«ã°ã«åã£ã¦ãã åããªãããã«ããã¤ãããªã®ã«ãã¾ã P(30)åããªãã 12ã§ãæ³å®å¤ã®å¤è§å½¢ãåºã¦ããã ãã£ã±ãå³å½¢æããªãã¨ããããªä¾ãå¤å¥â¦
http://projecteuler.net/index.php?section=problems&id=44 ã¨ã¦ãé ãã確ãéããèããã»ããéãã¯ãã
http://projecteuler.net/index.php?section=problems&id=32 yieldã使ãã¨ä½ã§ãç°¡åã«æ¸ãã¾ããå¤ãæç¸ã§ããªãã¨ãããåé¡ã§ããã
http://projecteuler.net/index.php?section=problems&id=43 æå¾ã«é ã«æ°åãã¤ããã¨ããã¯ã45ãããã®æ°ã®åæ¡ã®åè¨ãå¼ãã°ããã
http://projecteuler.net/index.php?section=problems&id=31 ç´ ç´ã«æ¸ãã¨æ¬¡ã®ããã«ãªãã§ããããã let coins = [ 1; 2; 5; 10; 20; 50; 100; 200 ] // nãã³ããmçªç®ã¾ã§ã®ã³ã¤ã³ã使ã£ã¦ä½éãã®è¡¨ãæ¹ãããã let rec num_ways n m = if n = 0 || m â¦
http://projecteuler.net/index.php?section=problems&id=30 éè¤çµåããèªä½ãã¾ããï¼15 + 25 + 25 = 25 + 15 + 25ã ããï¼ãyieldã使ãã¨ç°¡åã§ããã let rec repeated_combination a n = seq { if n = 0 then yield [] else if a <> [] then for b inâ¦