P-99
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. t(3, t(2, t(1, nil, nil), nil), t(5, nil, t(7, nil, nil))) Yes No
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. t('x', t('x', t('x', nil, nil), nil), t('x', nil, nil)) t('x', t('x', nil, t('x', nil, nil)), t('x', nil, nil)) t('x', t('x', nil, nil), t('x', t('x', nil, nil), nil)) t(…
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. Mercuryでは以下のようなユーザ定義型でTreeを表すので、形式のチェックは不要。 :- type tree(T) ---> t(T, tree(T), tree(T)) ; nil.
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. [{'a', "0"}, {'b', "101"}, {'c', "100"}, {'d', "111"}, {'e', "1101"}, {'f', "1100"}]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. ["000", "001", "011", "010", "110", "111", "101", "100"]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. no no no yes no no yes yes no yes no yes no yes yes yes yes no no yes yes no yes yes yes yes no yes yes yes yes yes
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. yes yes yes yes no yes no yes no no no no
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. yes yes yes yes no yes no yes no no no no
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. $ time ./p99_39a 4032 real 0m12.336s user 0m12.340s sys 0m0.005s $ time ./p99_39b 4032 real 0m1.221s user 0m1.216s sys 0m0.006s 2.10 の解法のほうが高速だった。 a) b)
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. 4
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. 4
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. yes
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. 9 9
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. 前半 10 = 3 + 7 12 = 5 + 7 14 = 3 + 11 16 = 3 + 13 18 = 5 + 13 20 = 3 + 17 後半 992 = 73 + 919 1382 = 61 + 1321 1856 = 67 + 1789 1928 = 61 + 1867 2078 = 61 + 2017 2438 = …
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. {5, 23}
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. [{3, 2}, {5, 1}, {7, 1}]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. [3, 3, 5, 7]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. Yes
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. a) [["o"], ["d", "e"], ["d", "e"], ["m", "n"], ["a", "b", "c"], ["f", "g", "h"], ["i", "j", "k", "l"]] b) [["i", "j", "k", "l"], ["o"], ["a", "b", "c"], ["f", "g", "h"], …
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. a) ["aldo", "beat"]["carla", "david", "evil"]["flip", "gary", "hugo", "ida"] ["aldo", "beat"]["carla", "david", "flip"]["evil", "gary", "hugo", "ida"] ["aldo", "beat"]["c…
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. ["a", "b", "c"] ["a", "b", "d"] ["a", "b", "e"] ["a", "b", "f"] ["a", "c", "d"] ["a", "c", "e"] ["a", "c", "f"] ["a", "d", "e"] ["a", "d", "f"] ["a", "e", "f"] ["b", "c",…
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. ["f", "e", "a", "c", "b", "d"]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. [3, 14, 25, 42, 17, 49]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. ["e", "h", "f"]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. [4, 5, 6, 7, 8, 9]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. ["a", "alfa", "b", "c", "d"]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. b ["a", "c", "d"]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. ["d", "e", "f", "g", "h", "a", "b", "c"] ["g", "h", "a", "b", "c", "d", "e", "f"]
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. ["c", "d", "e", "f", "g"]