給定字符序列 $\mathscr{A}$,求由這些字符組成且長度小於等於 k 的所有字串。這些字串須依照 $\mathscr{A}$ 字典序排列。

Given: A permutation of at most 12 symbols defining an ordered alphabet $\mathscr{A}$ and a positive integer n (n≤4).

Return: All strings of length at most n formed from $\mathscr{A}$, ordered lexicographically. (Note: As in “Enumerating k-mers Lexicographically”, alphabet order is based on the order in which the symbols are given.)

(https://rosalind.info/problems/lexv/)

閱讀全文 »

給定字符序列 $\mathscr{A}$,求由這些字符組成且長度為 k 的所有字串。這些字串須依照 $\mathscr{A}$ 字典序排列。

Given: A permutation of at most 12 symbols defining an ordered alphabet $\mathscr{A}$ and a positive integer n (n≤4).

Return: All strings of length at most n formed from $\mathscr{A}$ , ordered lexicographically. (Note: As in “Enumerating k-mers Lexicographically”, alphabet order is based on the order in which the symbols are given.)

(https://rosalind.info/problems/lexv/)

閱讀全文 »

給定一正整數 n,求包含數字 1 到 n 與 -1 到 -n 的所有可能數列與其總數。

A signed permutation of length n is some ordering of the positive integers {1,2,…,n} in which each integer is then provided with either a positive or negative sign (for the sake of simplicity, we omit the positive sign). For example, π=(5,−3,−2,1,4) is a signed permutation of length 5

Given: A positive integer n≤6

Return: The total number of signed permutations of length n, followed by a list of all such permutations (you may list the signed permutations in any order).

閱讀全文 »

給定一正整數 n,求包含數字 1 到 n 的所有可能數列與其總數。

A permutation of length n is an ordering of the positive integers {1,2,…,n} . For example, π=(5,3,2,1,4) is a permutation of length 5.

Given: A positive integer n≤7 .

Return: The total number of permutations of length n , followed by a list of all such permutations (in any order).

(https://rosalind.info/problems/perm/)

閱讀全文 »

小說1是以主角朋友的紀錄呈現。開頭場景類似電影《來自地球的人》,是一場舉行在主角家裡的沙龍。當一夥人正熱烈討論著時空本質時,主角現身向他們展示了正在打造的時光機器。不過要到主角衣衫襤褸,渾身是傷地出現在再次造訪的友人面前,讀者才得以讀到由敘事者轉述,主角經歷的未來冒險。

閱讀全文 »

1958年,三島由紀夫在《明星週刊》連載不道德教育講座,針對當代日本的文化、事件與風俗,提出有違常人價值觀的看法,例如「應該盡量說謊」、「要打從心底瞧不起老師」、還倡議「千萬不要遵守諾言」。

據他所述,老掉牙的說教作品無趣又矯情,與其重述時下倡導的道德教育,不如談些大逆不道的誇張故事還來得有趣。畢竟,讀者在看了這些荒謬情節之後,沒有產生群起效法的念頭,反倒被激起高尚的品德也說不定。

坦白講,讀過三島由紀夫其他詞藻華美、情節扭曲的小說之後,很難想像這些專欄文章出自同一人之手。《不道德教育講座》裡頭雖然有些看法引人深思,但也充滿反串、強詞奪理、偏見和誇飾的論述,簡直就像是穿越回二十世紀中葉的 PTT 八卦版鄉民。

閱讀全文 »
0%